huifu.conf 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # https://www.nginx.com/resources/wiki/start/
  5. # https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
  6. # https://wiki.debian.org/Nginx/DirectoryStructure
  7. #
  8. # In most cases, administrators will remove this file from sites-enabled/ and
  9. # leave it as reference inside of sites-available where it will continue to be
  10. # updated by the nginx packaging team.
  11. #
  12. # This file will automatically load configuration files provided by other
  13. # applications, such as Drupal or Wordpress. These applications will be made
  14. # available underneath a path with that package name, such as /drupal8.
  15. #
  16. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  17. ##
  18. # Default server configuration
  19. #
  20. server {
  21. listen 81 default_server;
  22. listen [::]:81 default_server;
  23. root /game/web/huifu;
  24. # Add index.php to the list if you are using PHP
  25. index index.html index.htm index.nginx-debian.html;
  26. server_name _;
  27. location ^~ /new_battle/ {
  28. proxy_pass http://dev.ic1101.world:8091;
  29. proxy_redirect off;
  30. proxy_set_header Host $host;
  31. proxy_set_header X-Real-IP $remote_addr;
  32. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  33. }
  34. location / {
  35. add_header 'Access-Control-Allow-Origin' '*';
  36. add_header 'Access-Control-Allow-Headers' '*';
  37. add_header 'Access-Control-Allow-Methods' '*';
  38. try_files $uri $uri/ =404;
  39. }
  40. }