nginx.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. user nginx;
  2. worker_processes auto;
  3. error_log /var/log/nginx/error.log notice;
  4. pid /var/run/nginx.pid;
  5. events {
  6. worker_connections 4096;
  7. }
  8. http {
  9. include /etc/nginx/mime.types;
  10. default_type application/octet-stream;
  11. log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  12. '$status $body_bytes_sent "$http_referer" '
  13. '"$http_user_agent" "$http_x_forwarded_for"';
  14. map $http_upgrade $connection_upgrade {
  15. default upgrade;
  16. '' close;
  17. }
  18. access_log /var/log/nginx/access.log main;
  19. sendfile on;
  20. #tcp_nopush on;
  21. client_max_body_size 50m;
  22. keepalive_timeout 65;
  23. #gzip on;
  24. server_tokens off;
  25. map $http_origin $allow_origin {
  26. default "";
  27. "~^(https?://localhost(:[0-9]+)?)$" $1;
  28. "~^(https?://127.0.0.1(:[0-9]+)?)$" $1;
  29. "~^(https?://172.10(.[\d]+){2}(:[0-9]+)?)$" $1;
  30. "~^(https?://192.168(.[\d]+){2}(:[0-9]+)?)$" $1;
  31. "~^(http://msa.js.sgcc.com.cn:6001)$" $1;
  32. "~^(http://20.47.197.214:9098)$" $1;
  33. "~^(http://21.47.224.120:19098)$" $1;
  34. }
  35. include /etc/nginx/conf.d/*.conf;
  36. }