Nenhuma Descrição

nginx copy.conf 2.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. user root;
  2. worker_processes auto;
  3. pid /run/nginx.pid;
  4. include /etc/nginx/modules-enabled/*.conf;
  5. events {
  6. worker_connections 768;
  7. # multi_accept on;
  8. }
  9. http {
  10. ##
  11. # Basic Settings
  12. ##
  13. sendfile on;
  14. tcp_nopush on;
  15. tcp_nodelay on;
  16. keepalive_timeout 65;
  17. types_hash_max_size 2048;
  18. # server_tokens off;
  19. # server_names_hash_bucket_size 64;
  20. # server_name_in_redirect off;
  21. include /etc/nginx/mime.types;
  22. default_type application/octet-stream;
  23. ##
  24. # SSL Settings
  25. ##
  26. ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
  27. ssl_prefer_server_ciphers on;
  28. ##
  29. # Logging Settings
  30. ##
  31. access_log /var/log/nginx/access.log;
  32. error_log /var/log/nginx/error.log;
  33. ##
  34. # Gzip Settings
  35. ##
  36. gzip on;
  37. # 大屏应用配置
  38. server {
  39. listen 9998;
  40. server_name 47.93.202.126;
  41. # location = /bigScreen {
  42. # return 302 $scheme://$http_host/bigScreen/;
  43. # }
  44. # 后台应用
  45. location / {
  46. alias /home/website/zlzh/bigScreen/dist/;
  47. index index.html;
  48. try_files $uri $uri/ /bg/index.html;
  49. }
  50. # API代理配置
  51. location /api {
  52. # 这里需要替换为你的实际API服务器地址
  53. proxy_pass http://127.0.0.1:8080; # 请修改为你的API服务器地址
  54. proxy_set_header Host $host;
  55. proxy_set_header X-Real-IP $remote_addr;
  56. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  57. proxy_set_header X-Forwarded-Proto $scheme;
  58. # 代理超时设置
  59. proxy_connect_timeout 60s;
  60. proxy_send_timeout 60s;
  61. proxy_read_timeout 60s;
  62. # WebSocket支持(如果需要)
  63. proxy_http_version 1.1;
  64. proxy_set_header Upgrade $http_upgrade;
  65. proxy_set_header Connection "upgrade";
  66. }
  67. }
  68. server {
  69. listen 9988;
  70. server_name 47.93.202.126;
  71. # location = /bigScreen {
  72. # return 302 $scheme://$http_host/bigScreen/;
  73. # }
  74. # 后台应用
  75. location / {
  76. alias /home/website/zlzh/web/dist/;
  77. index index.html;
  78. try_files $uri $uri/ /index.html;
  79. }
  80. }
  81. include /etc/nginx/conf.d/*.conf;
  82. include /etc/nginx/sites-enabled/*;
  83. }