这个配置文件就是完整可用的nginx与PHP unix socket通信配置。server {
listen 80;
server_name xxx.plus;
add_header Strict-Transport-Security max-age=15768000;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl;
server_name xxx.plus;
ssl_certificate cert/xxx.plus.crt;
ssl_certificate_key cert/xxx.plus.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
#access_log logs/xxx-access.log;
#error_log logs/xxx-error.log;
root /data/d1/public;
index index.html index.htm index.php;
location / {
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
fastcgi_pass unix:/dev/shm/php70-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
location ~ .*\.(jpg|jpeg|gif|png|js|css)$ {
expires 30d;
access_log off;
valid_referers none blocked xxx.plus;
if ($invalid_referer){
return 403;
}
}
}
打赏
微信扫一扫,打赏作者吧~