server {
listen 80;
server_name fpb.com;
return 301 http://www.fpb.com$request_uri;
}
server
{
listen 80;
#listen [::]:80;
server_name www.fpb.com;
index index.html index.htm index.php default.html default.htm default.php;
root /home/wwwroot/www.fpb.com;
include dedecms.conf;
#error_page 404 /404.html;
# Deny access to PHP files in specific directory
#location ~ /(wp-content|uploads|wp-includes|images)/.*\.php$ { deny all; }
include enable-php.conf;
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
{
expires 30d;
}
location ~ .*\.(js|css)?$
{
expires 12h;
}
location ~ /.well-known {
allow all;
}
location ~ /\.
{
deny all;
}
access_log off;
}
server {
listen 80;
server_name m.fpb.com;
location / {
root ../a;
proxy_pass http://www.fpb.com/m/;
}
#error_page 500 502 503 504 /50x.html;
}
server {
listen 80;
server_name zg.fpb.com;
location /templets/{
proxy_pass http://www.fpb.com/templets/;
}
location /a/{
proxy_pass http://www.fpb.com/a/;
}
location /uploads/{
proxy_pass http://www.fpb.com/uploads/;
}
location / {
proxy_pass http://www.fpb.com/a/;
}
#error_page 500 502 503 504 /50x.html;
}
ng配置301及反向代理示例
点赞
收藏