diff options
Diffstat (limited to 'nginx/sites-available')
-rw-r--r-- | nginx/sites-available/vps | 44 |
1 files changed, 26 insertions, 18 deletions
diff --git a/nginx/sites-available/vps b/nginx/sites-available/vps index 9953def..afc5714 100644 --- a/nginx/sites-available/vps +++ b/nginx/sites-available/vps | |||
@@ -16,7 +16,7 @@ map $uri $basename { | |||
16 | } | 16 | } |
17 | 17 | ||
18 | server { | 18 | server { |
19 | server_name topo.tw www.topo.tw; | 19 | server_name topo.tw www.topo.tw "~[\d\.]+"; |
20 | 20 | ||
21 | listen 80; | 21 | listen 80; |
22 | listen 443 ssl; | 22 | listen 443 ssl; |
@@ -26,10 +26,21 @@ server { | |||
26 | # files | 26 | # files |
27 | root /srv/http; | 27 | root /srv/http; |
28 | index index.html; | 28 | index index.html; |
29 | autoindex on; | 29 | #autoindex on; |
30 | autoindex_exact_size off; | 30 | #autoindex_exact_size off; |
31 | disable_symlinks off; | 31 | disable_symlinks off; |
32 | 32 | ||
33 | include /home/pham/site/nginx/modules/fancyindex/fancyindex.conf; | ||
34 | |||
35 | location ^~ /fancyindex/ { | ||
36 | root /home/pham/site/nginx/modules; | ||
37 | } | ||
38 | |||
39 | #include /home/pham/git/Nginx-Fancyindex-Theme/fancyindex.conf; | ||
40 | #location ^~ /Nginx-Fancyindex-Theme-light/ { | ||
41 | # root /home/pham/git/Nginx-Fancyindex-Theme; | ||
42 | #} | ||
43 | |||
33 | # charset | 44 | # charset |
34 | charset utf-8; | 45 | charset utf-8; |
35 | charset_types *; | 46 | charset_types *; |
@@ -51,15 +62,15 @@ server { | |||
51 | add_header Access-Control-Allow-Origin *; | 62 | add_header Access-Control-Allow-Origin *; |
52 | } | 63 | } |
53 | 64 | ||
65 | rewrite ^/cgi$ /cgi/ permanent; | ||
54 | location = /cgi/ { | 66 | location = /cgi/ { |
55 | alias /srv/cgi/; | 67 | alias /srv/cgi/; |
68 | fancyindex_ignore Makefile fastcgi.*; | ||
56 | } | 69 | } |
57 | 70 | ||
58 | location ~ /cgi/(.*) { | 71 | location ~ /cgi/(.*) { |
59 | gzip off; | 72 | gzip off; |
60 | |||
61 | include /etc/nginx/fastcgi_params; | 73 | include /etc/nginx/fastcgi_params; |
62 | # fastcgi_pass unix:/var/run/fcgiwrap.sock; | ||
63 | fastcgi_pass unix:/srv/cgi/fastcgi.sock; | 74 | fastcgi_pass unix:/srv/cgi/fastcgi.sock; |
64 | fastcgi_param SCRIPT_FILENAME /srv/cgi/$1; | 75 | fastcgi_param SCRIPT_FILENAME /srv/cgi/$1; |
65 | error_log /tmp/cgi info; | 76 | error_log /tmp/cgi info; |
@@ -84,10 +95,6 @@ server { | |||
84 | 95 | ||
85 | rewrite ^/posts$ /posts/ permanent; | 96 | rewrite ^/posts$ /posts/ permanent; |
86 | location = /posts/ { | 97 | location = /posts/ { |
87 | autoindex_format xml; | ||
88 | xslt_string_param title "/posts/"; | ||
89 | xslt_stylesheet layout/simple.xslt; | ||
90 | add_header Cache-Control "no-cache" always; | ||
91 | } | 98 | } |
92 | 99 | ||
93 | # This configuration allow you to upload/modify/delete file, for example: | 100 | # This configuration allow you to upload/modify/delete file, for example: |
@@ -104,9 +111,9 @@ server { | |||
104 | 111 | ||
105 | location ^~ /photos/ { | 112 | location ^~ /photos/ { |
106 | alias /home/pham/data/s3.photos/; | 113 | alias /home/pham/data/s3.photos/; |
107 | autoindex_format xml; | 114 | #autoindex_format xml; |
108 | xslt_string_param title "photos"; | 115 | #xslt_string_param title "photos"; |
109 | xslt_stylesheet layout/gal.xslt; | 116 | #xslt_stylesheet layout/gal.xslt; |
110 | try_files $uri $uri/ =404; | 117 | try_files $uri $uri/ =404; |
111 | expires max; | 118 | expires max; |
112 | 119 | ||
@@ -172,6 +179,7 @@ server { | |||
172 | location ^~ /wallpapers { | 179 | location ^~ /wallpapers { |
173 | alias /home/pham/public/wallpapers/; | 180 | alias /home/pham/public/wallpapers/; |
174 | 181 | ||
182 | autoindex on; | ||
175 | autoindex_format xml; | 183 | autoindex_format xml; |
176 | xslt_string_param title "Wallpaper Collection!"; | 184 | xslt_string_param title "Wallpaper Collection!"; |
177 | xslt_stylesheet layout/gal.xslt; | 185 | xslt_stylesheet layout/gal.xslt; |
@@ -318,12 +326,12 @@ server { | |||
318 | } | 326 | } |
319 | 327 | ||
320 | # Block all direct accesses via IP address | 328 | # Block all direct accesses via IP address |
321 | server { | 329 | #server { |
322 | server_name "~[\d\.]+"; | 330 | # server_name "~[\d\.]+"; |
323 | listen 80; | 331 | # listen 80; |
324 | error_page 404 /404.html; | 332 | # error_page 404 /404.html; |
325 | return 404; | 333 | # return 404; |
326 | } | 334 | #} |
327 | 335 | ||
328 | ## Redirect 80 to 443 | 336 | ## Redirect 80 to 443 |
329 | #server { | 337 | #server { |