nginx.conf 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # For more information on configuration, see:
  2. # * Official English Documentation: http://nginx.org/en/docs/
  3. # * Official Russian Documentation: http://nginx.org/ru/docs/
  4. user nginx;
  5. worker_processes auto;
  6. error_log /var/log/nginx/error.log;
  7. pid /run/nginx.pid;
  8. worker_rlimit_nofile 51200;
  9. # Load dynamic modules. See /usr/share/doc/nginx/README.dynamic.
  10. include /usr/share/nginx/modules/*.conf;
  11. events {
  12. worker_connections 2048;
  13. }
  14. http {
  15. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  16. '$status $body_bytes_sent "$http_referer" '
  17. '"$http_user_agent" "$http_x_forwarded_for"';
  18. access_log /var/log/nginx/access.log main;
  19. sendfile on;
  20. tcp_nopush on;
  21. tcp_nodelay on;
  22. keepalive_timeout 6;
  23. types_hash_max_size 2048;
  24. include /etc/nginx/mime.types;
  25. default_type application/octet-stream;
  26. # Load modular configuration files from the /etc/nginx/conf.d directory.
  27. # See http://nginx.org/en/docs/ngx_core_module.html#include
  28. # for more information.
  29. include /etc/nginx/conf.d/*.conf;
  30. server {
  31. listen 443 ssl;
  32. server_name venus.kuaidianban.cn;
  33. root /usr/share/nginx/html;
  34. ssl_certificate "/etc/pki/nginx/cert.crt";
  35. ssl_certificate_key "/etc/pki/nginx/private.key";
  36. ssl_session_cache shared:SSL:1m;
  37. ssl_session_timeout 5m;
  38. ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  39. ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;
  40. ssl_prefer_server_ciphers on;
  41. # Load configuration files for the default server block.
  42. include /etc/nginx/default.d/*.conf;
  43. location / {
  44. try_files $uri $uri/ /index.html;
  45. }
  46. location /venus/ {
  47. proxy_pass https://127.0.0.1:8888/venus/;
  48. add_header Access-Control-Allow-Origin *;
  49. add_header 'Access-Control-Allow-Credentials' 'true';
  50. add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
  51. add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
  52. add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  53. proxy_set_header Host $http_host;
  54. proxy_http_version 1.1;
  55. proxy_set_header Upgrade $http_upgrade;
  56. proxy_set_header Connection "upgrade";
  57. }
  58. location /adminapi/ {
  59. proxy_pass https://brace.0592jizhang.com/adminapi/;
  60. add_header Access-Control-Allow-Origin *;
  61. add_header 'Access-Control-Allow-Credentials' 'true';
  62. add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
  63. add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
  64. add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  65. }
  66. location /api/ {
  67. proxy_pass https://brace.0592jizhang.com/api/;
  68. add_header Access-Control-Allow-Origin *;
  69. add_header 'Access-Control-Allow-Credentials' 'true';
  70. add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
  71. add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
  72. add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  73. }
  74. location /services/ {
  75. proxy_pass http://open.api.tianyancha.com/services/;
  76. add_header Access-Control-Allow-Origin *;
  77. add_header 'Access-Control-Allow-Credentials' 'true';
  78. add_header Access-Control-Allow-Methods "POST, GET, OPTIONS";
  79. add_header Access-Control-Allow-Headers "Origin, Authorization, Accept";
  80. add_header 'Access-Control-Allow-Headers' 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type';
  81. }
  82. error_page 404 /404.html;
  83. location = /404.html {
  84. }
  85. error_page 500 502 503 504 /50x.html;
  86. location = /50x.html {
  87. }
  88. }
  89. }