nginx.conf 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. log_format bodylog escape=json '$remote_addr - [$time_local] '
  23. '"$request" $status $body_bytes_sent '
  24. '"$http_referer" "$http_user_agent" '
  25. '"$request_body"';
  26. server {
  27. listen 19000 ssl;
  28. access_log e:\\nginx-1.20.2\\logs\\worksheet.access.log bodylog;
  29. error_log e:\\nginx-1.20.2\\logs\\worksheet.error.log notice;
  30. # 网站域名
  31. server_name oa.ysstech.com;
  32. # 网站根目录
  33. root e:\\nginx-1.20.2\\workSheet;
  34. index index.html;
  35. #将 cert-file-name.pem 替换成已上传的证书文件的名称。
  36. ssl_certificate e:\\nginx-1.20.2\\cert\\7494583_oa.ysstech.com.pem;
  37. #将 cert-file-name.key 替换成已上传的证书私钥文件的名称。
  38. ssl_certificate_key e:\\nginx-1.20.2\\cert\\7494583_oa.ysstech.com.key;
  39. ssl_session_timeout 5m;
  40. ssl_ciphers ECDHE-RSA-AES128-GCMSHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
  41. ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
  42. ssl_prefer_server_ciphers on;
  43. # 网页不缓存
  44. location / {
  45. etag off;
  46. add_header Cache-Control "private, no-store, no-cache,must-revalidate, proxy-revalidate";
  47. try_files $uri /index.html;
  48. }
  49. # 普通的 js、css 等资源文件可缓存
  50. location /assets/ {}
  51. location = /favicon.ico {}
  52. # api 代理
  53. location /timeSheet/ {
  54. # 替换成服务端的 api 地址
  55. etag off;
  56. add_header Cache-Control "private, no-store, no-cache,must-revalidate, proxy-revalidate";
  57. proxy_pass http://localhost:9090;
  58. }
  59. }
  60. }