adweb3.conf 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. map $http_upgrade $connection_upgrade {
  2. default upgrade;
  3. 'websocket' upgrade;
  4. }
  5. server {
  6. listen 80;
  7. listen 443 ssl;
  8. server_name v3.adwebcloud.com zhigeng.adwebcloud.com;
  9. # 日志地址
  10. access_log /var/log/nginx/access.log;
  11. error_log /var/log/nginx/error.log;
  12. ssl_certificate /root/.acme.sh/v3.adwebcloud.com_ecc/fullchain.cer;
  13. ssl_certificate_key /root/.acme.sh/v3.adwebcloud.com_ecc/v3.adwebcloud.com.key;
  14. include /etc/nginx/conf.d/adweb3/*.conf;
  15. index index.html;
  16. root /home/ubuntu/adweb3-web/dist; # 这里改成前端静态
  17. location / {
  18. try_files $uri $uri/ /index.html;
  19. # 后端 API 的转发
  20. location /adweb3/ {
  21. proxy_set_header Upgrade $http_upgrade;
  22. proxy_set_header Connection $connection_upgrade;
  23. proxy_pass http://127.0.0.1:8080;
  24. }
  25. location /adweb3/websocket/ {
  26. proxy_pass http://127.0.0.1:8080/adweb3/websocket/;
  27. proxy_http_version 1.1;
  28. proxy_set_header Upgrade $http_upgrade;
  29. proxy_set_header Connection "Upgrade";
  30. proxy_set_header X-real-ip $remote_addr;
  31. proxy_set_header X-Forwarded-For $remote_addr;
  32. }
  33. }
  34. }
  35. server {
  36. listen 80;
  37. server_name xxl-job.v3.adwebcloud.com;
  38. # 日志地址
  39. access_log /var/log/nginx/access.log;
  40. error_log /var/log/nginx/error.log;
  41. location / {
  42. # 后端 API 的转发
  43. location / {
  44. proxy_set_header Upgrade $http_upgrade;
  45. proxy_set_header Connection $connection_upgrade;
  46. proxy_pass http://127.0.0.1:8090;
  47. }
  48. }
  49. }