1- # You may add here your
2- # server {
3- # ...
4- # }
5- # statements for each of your virtual hosts to this file
6-
7- ##
8- # You should look at the following URL's in order to grasp a solid understanding
9- # of Nginx configuration files in order to fully unleash the power of Nginx.
10- # http://wiki.nginx.org/Pitfalls
11- # http://wiki.nginx.org/QuickStart
12- # http://wiki.nginx.org/Configuration
13- #
14- # Generally, you will want to move this file somewhere, and start with a clean
15- # file but keep this around for reference. Or just disable in sites-enabled.
16- #
17- # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
18- ##
19-
201server {
212listen 6080 default_server;
223listen [::]:6080 default_server ipv6only=on;
@@ -25,7 +6,23 @@ server {
256index index .html index .htm;
267
278 location / {
28- try_files $uri $uri / @proxy;
9+ try_files $uri @proxy;
10+ }
11+
12+ location = / {
13+ try_files $uri @proxy2;
14+ }
15+
16+ location = /redirect.html {
17+ try_files $uri @proxy2;
18+ }
19+
20+ location @proxy2 {
21+ proxy_set_header X-Real-IP $remote_addr ;
22+ proxy_set_header X-Forwarded-For $remote_addr ;
23+ proxy_set_header Host $host ;
24+ proxy_pass http ://127.0.0.1:6079 ;
25+ max_ranges 0;
2926 }
3027
3128 location @proxy {
@@ -36,93 +33,10 @@ server {
3633 max_ranges 0;
3734 }
3835
39- location /websockify {
40- proxy_pass http ://127.0.0.1:6081 ;
36+ location = /websockify {
4137 proxy_http_version 1.1;
4238 proxy_set_header Upgrade $http_upgrade ;
4339 proxy_set_header Connection "upgrade" ;
40+ proxy_pass http ://127.0.0.1:6081 ;
4441 }
45-
46- #location / {
47- # # First attempt to serve request as file, then
48- # # as directory, then fall back to displaying a 404.
49- # try_files $uri $uri/ =404;
50- # # Uncomment to enable naxsi on this location
51- # # include /etc/nginx/naxsi.rules
52- # }
53-
54- # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
55- #location /RequestDenied {
56- # proxy_pass http://127.0.0.1:8080;
57- #}
58-
59- #error_page 404 /404.html;
60-
61- # redirect server error pages to the static page /50x.html
62- #
63- #error_page 500 502 503 504 /50x.html;
64- #location = /50x.html {
65- # root /usr/share/nginx/html;
66- #}
67-
68- # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
69- #
70- #location ~ \.php$ {
71- # fastcgi_split_path_info ^(.+\.php)(/.+)$;
72- # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
73- #
74- # # With php5-cgi alone:
75- # fastcgi_pass 127.0.0.1:9000;
76- # # With php5-fpm:
77- # fastcgi_pass unix:/var/run/php5-fpm.sock;
78- # fastcgi_index index.php;
79- # include fastcgi_params;
80- #}
81-
82- # deny access to .htaccess files, if Apache's document root
83- # concurs with nginx's one
84- #
85- #location ~ /\.ht {
86- # deny all;
87- #}
8842}
89-
90-
91- # another virtual host using mix of IP-, name-, and port-based configuration
92- #
93- #server {
94- # listen 8000;
95- # listen somename:8080;
96- # server_name somename alias another.alias;
97- # root html;
98- # index index.html index.htm;
99- #
100- # location / {
101- # try_files $uri $uri/ =404;
102- # }
103- #}
104-
105-
106- # HTTPS server
107- #
108- #server {
109- # listen 443;
110- # server_name localhost;
111- #
112- # root html;
113- # index index.html index.htm;
114- #
115- # ssl on;
116- # ssl_certificate cert.pem;
117- # ssl_certificate_key cert.key;
118- #
119- # ssl_session_timeout 5m;
120- #
121- # ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
122- # ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
123- # ssl_prefer_server_ciphers on;
124- #
125- # location / {
126- # try_files $uri $uri/ =404;
127- # }
128- #}
0 commit comments