发布:2022/11/29 15:33:46作者:管理员 来源:本站 浏览次数:803
upstream www.ejk5.com {
server localhost:8888 weight=1;
#server localhost:90 weight=2;
}
server {
listen 80;
server_name www.ejk5.com ejk5.com;
if ($host != 'www.ejk5.com') {
#讲http://ejk5.com转http://www.ejk5.com
rewrite ^/(.*)$ http://www.ejk5.com/$1 permanent;
}
client_max_body_size 10m;
location ^~ /content/ {
#/content/转.* /news/show-4.html
rewrite .* /news/show-4.html;
}
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header REMOTE-HOST $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
#proxy_set_header Host $host:$server_port;
proxy_redirect off;
index index.html index.htm;
proxy_pass http://www.ejk5.com;
}
location /news {
#站中站
proxy_pass http://localhost:8889/;
}
}