比如有两个项目,希望访问的端口号都是80端口,可进行如下配置:
server {
listen 80;
server_name localhost;
server_name_in_redirect off;
proxy_set_header Host $host:$server_port;
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;
location / {
proxy_pass
}
location /group1/M00 {
alias /data/images/data;
ngx_fastdfs_module;
}
}