nginx本地访问配置

server {
listen 80;
server_name old.dmgcf.com;
rewrite ^(.*) https://old.dmgcf.com$1 permanent;
#location /nginx_status{
#stub_status on;
#access_log off;
#allow 127.0.0.1;
#allow 106.120.182.134;
#deny all;
#}
}
server {
listen 443;
server_name old.dmgcf.com;
access_log logs/com.access.log main;
error_log logs/com.error.log;
ssl on;
ssl_certificate /usr/local/nginx/conf/ssl/2019/server.cer;
ssl_certificate_key /usr/local/nginx/conf/ssl/2019/server.key;
ssl_session_timeout 5m;
ssl_session_cache shared:SSL:1m;
ssl_ciphers HIGH:!aNULL:!MD5;
ssl_prefer_server_ciphers on;
#location ~ /site/\SendCode {
# if ($http_referer ~ "https://old.dmgcf.com/site/SendCode") {
# return 403;
# }
# proxy_pass http://.dmgcf.com:81;
#}

location / {
root /data/web/redman;
index index.html index.htm index.php;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
}
location ~ \.php$ {
root /data/web/redman;
fastcgi_pass 172.17.10.153:9000;
fastcgi_index index.php;
fastcgi_connect_timeout 60;
fastcgi_read_timeout 600;
fastcgi_send_timeout 600;
# # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

}
server {
listen 81;
server_name www.dmgcf.com;
access_log logs/access.log ;
error_log logs/error.log;
location / {
root /data/web/redman;
index index.html index.htm index.php;
if (!-e $request_filename){
rewrite ^/(.*) /index.php last;
}
if ($http_user_agent ~* "GTX\s+LOL")
{
return 404;
}
}
location ~ \.php$ {
root /data/web/redman;
#fastcgi_pass 127.0.0.1:9000;
fastcgi_pass 172.17.10.153:9000;
#fastcgi_pass webpc;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}
}

转载于:https://www.cnblogs.com/fangdecheng/p/10634703.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值