HTTP协议

HTTPS协议

  1. server {
  2. listen 443 ssl;
  3. server_name its.ourwaysoft.com;
  4. ssl_certificate /usr/local/nginx/cert/6062016_its.ourwaysoft.com.pem;
  5. ssl_certificate_key /usr/local/nginx/cert/6062016_its.ourwaysoft.com.key;
  6. ssl_session_cache shared:SSL:1m;
  7. ssl_session_timeout 5m;
  8. ssl_ciphers HIGH:!aNULL:!MD5;
  9. ssl_prefer_server_ciphers on;
  10. location / {
  11. root /project/OurwayITS/web/dist;
  12. index index.html index.htm;
  13. }
  14. location /api/ {
  15. proxy_pass http://127.0.0.1:50001/;
  16. proxy_set_header Host $host;
  17. proxy_set_header X-Real-IP $remote_addr;
  18. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  19. }
  20. }

websocket配置

server {
        location /websocket/{
                proxy_pass http://localhost:50002/websocket/;
                proxy_set_header Host $http_host;

                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection "Upgrade";
                proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
                proxy_set_header X-Real-IP $remote_addr;
        }
}