1. #user nobody;
    2. worker_processes 1;
    3. #error_log logs/error.log;
    4. #error_log logs/error.log notice;
    5. #error_log logs/error.log info;
    6. #pid logs/nginx.pid;
    7. events {
    8. worker_connections 1024;
    9. }
    10. http {
    11. include mime.types;
    12. default_type application/octet-stream;
    13. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
    14. # '$status $body_bytes_sent "$http_referer" '
    15. # '"$http_user_agent" "$http_x_forwarded_for"';
    16. #access_log logs/access.log main;
    17. sendfile on;
    18. #tcp_nopush on;
    19. #keepalive_timeout 0;
    20. keepalive_timeout 65;
    21. #gzip on;
    22. server {
    23. listen 8999;
    24. server_name 192.168.70.215;
    25. #charset koi8-r;
    26. #access_log logs/host.access.log main;
    27. location /{
    28. root /usr/local/nginx/dist/dist;
    29. try_files $uri $uri/ /index.html;
    30. # 禁用缓存
    31. add_header Cache-Control no-store;
    32. }
    33. location /wsapi/
    34. {
    35. # 若访问的是 http:// http://127.0.0.1:8999/wsapi/system/getuser
    36. # 则 nginx会转发 http://127.0.0.1:8300/system/getuser
    37. proxy_pass http://127.0.0.1:8300/;
    38. proxy_redirect off;
    39. proxy_read_timeout 180s;
    40. proxy_cookie_path /* /;
    41. proxy_set_header Cookie $http_cookie;
    42. # 禁用缓存
    43. add_header Cache-Control no-store;
    44. }
    45. }
    46. }