解决方案就是:
nginx只针对/etc/nginx/nginx.conf的配置文件起作用
不要在/etc/nginx/conf.d文件夹下创建针对不同web服务的conf文件,而是直接在/etc/nginx文件夹下修改nginx.conf (最好将原先的保存一份为nginx.conf.back)
将8880端口的服务转发到80端口上:
worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 80; server_name localhost; access_log /var/log/mbook-access.log; error_log /var/log/mbook-error.log; location / { proxy_pass http://127.0.0.1:8880; proxy_redirect off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } } }
标签:log,端口,nginx,proxy,conf,80 From: https://www.cnblogs.com/luxiayuai/p/17768352.html