Skip to content

Instantly share code, notes, and snippets.

@uicosp
Created August 15, 2018 17:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save uicosp/223f3b7c4c3968a02729c0ac012f2b4f to your computer and use it in GitHub Desktop.
Save uicosp/223f3b7c4c3968a02729c0ac012f2b4f to your computer and use it in GitHub Desktop.
Nginx HTTPS 配置
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