server {
listen 80;
server_name _default_;
root /home/wwwroot/public; #你的根目錄
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
include enable_php.conf;
}
}
server {
listen 443 ssl;
server_name test.cn; #你的域名
ssl_certificate /home/ssl/test.pem; #你的證書
ssl_certificate_key /home/ssl/test.key; #你的證書
ssl_session_timeout 5m;
ssl_protocols SSLv2 SSLv3 TLSv1;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
root /home/wwwroot/public; #你的根目錄
index index.html index.htm index.php;
location / {
index index.html index.htm index.php;
if (!-e $request_filename) {
rewrite ^(.*)$ /index.php?s=/$1 last;
break;
}
}
location ~ \.php$ {
include enable_php.conf;
}
}
重啓
service nginx restart
service php-fpm restart
簡單地配置nginx+PHP 僞靜態ssl和80
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.