default.conf 941 B

12345678910111213141516171819202122232425262728293031
  1. server {
  2. listen 80;
  3. listen [::]:80;
  4. server_name localhost;
  5. #access_log /var/log/nginx/host.access.log main;
  6. # location / {
  7. # root /usr/share/nginx/html;
  8. # index index.html index.htm;
  9. # }
  10. #error_page 404 /404.html;
  11. # redirect server error pages to the static page /50x.html
  12. #
  13. error_page 500 502 503 504 /50x.html;
  14. location = /50x.html {
  15. root /usr/share/nginx/html;
  16. }
  17. # 客户端上传文件最大值
  18. # client_max_body_size 50M;
  19. # client_body_buffer_size 30M;
  20. location / {
  21. proxy_set_header Host $host:$server_port; #远程主机 IP:PORT
  22. proxy_set_header X-Real-PORT $remote_port; #远程端口
  23. proxy_set_header X-Real-IP $remote_addr; #远程地址
  24. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; #远程代理地址
  25. proxy_pass http://copter-train:8101/;
  26. }
  27. }