image.png

    生成的配置文件如下:

    1. #PROXY-START/api
    2. location ~* \.(php|jsp|cgi|asp|aspx)$
    3. {
    4. proxy_pass http://localhost:8292;
    5. proxy_set_header Host $host;
    6. proxy_set_header X-Real-IP $remote_addr;
    7. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    8. proxy_set_header REMOTE-HOST $remote_addr;
    9. }
    10. location /api
    11. {
    12. proxy_pass http://localhost:8292;
    13. proxy_set_header Host $host;
    14. proxy_set_header X-Real-IP $remote_addr;
    15. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    16. proxy_set_header REMOTE-HOST $remote_addr;
    17. add_header X-Cache $upstream_cache_status;
    18. #Set Nginx Cache
    19. add_header Cache-Control no-cache;
    20. expires 12h;
    21. }
    22. #PROXY-END/api