1. upstream backend {
    2. server localhost:8080; # 程序监听端口
    3. }
    4. server {
    5. listen 80;
    6. server_name novel.easyboot.xyz; # 博客域名
    7. access_log off;
    8. location / {
    9. proxy_pass http://backend$request_uri;
    10. proxy_set_header Host $http_host;
    11. proxy_set_header X-Real-IP $remote_addr;
    12. client_max_body_size 10m;
    13. }
    14. }

    请务必配置

    proxy_set_header  Host $http_host;
    proxy_set_header  X-Real-IP $remote_addr;