Created
August 15, 2018 17:43
-
-
Save uicosp/223f3b7c4c3968a02729c0ac012f2b4f to your computer and use it in GitHub Desktop.
Nginx HTTPS 配置
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name example.org; | |
access_log off; | |
return 301 https://$host$request_uri; | |
} | |
server { | |
listen 443 ssl; | |
server_name example.org; | |
access_log off; | |
ssl_certificate /etc/nginx/ssl/example.org/cert.pem; | |
ssl_certificate_key /etc/nginx/ssl/example.org/cert.key; | |
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE; | |
ssl_prefer_server_ciphers on; | |
root /var/www/example.org/current/public; | |
index index.php index.html index.htm; | |
try_files $uri $uri/ /index.php?$query_string; | |
location ~ \.php$ { | |
fastcgi_pass 127.0.0.1:9000; | |
include fastcgi_params; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
#当需要跨域请求时开启 | |
#include conf.d/example_org_cors_support; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment