diff options
author | Hsieh Chin Fan <pham@topo.tw> | 2024-12-17 14:05:22 +0800 |
---|---|---|
committer | Hsieh Chin Fan <pham@topo.tw> | 2024-12-17 14:05:22 +0800 |
commit | 585d411f892f10709a82a93147bff2fd17f35205 (patch) | |
tree | 75d28d9914553ceb3f0400fd6bfa96a57db3eddb /nginx/sites-available | |
parent | 5713eb4bfd465beef627f0c89b996d090f593603 (diff) |
nginx: update
Diffstat (limited to 'nginx/sites-available')
-rw-r--r-- | nginx/sites-available/vps | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/nginx/sites-available/vps b/nginx/sites-available/vps index 820f346..d1d50fb 100644 --- a/nginx/sites-available/vps +++ b/nginx/sites-available/vps | |||
@@ -54,16 +54,7 @@ server { | |||
54 | error_log /var/log/nginx/error.log debug; | 54 | error_log /var/log/nginx/error.log debug; |
55 | #rewrite_log on; | 55 | #rewrite_log on; |
56 | 56 | ||
57 | # RSS Feed for various names | 57 | try_files $uri $uri"index.html" $uri/index.html @rewrite_no_slash; |
58 | # ref: https://blog.jim-nielsen.com/2021/feed-urls/ | ||
59 | location ~ (rss|index.xml|atom.xml|feed|feed.xml|feed.atom)$ { | ||
60 | alias /srv/http/feed.rss; | ||
61 | add_header Content-Type "text/xml; charset=utf-8"; | ||
62 | } | ||
63 | |||
64 | location ~ [^/]$ { | ||
65 | try_files $uri @rewrite_no_slash; | ||
66 | } | ||
67 | 58 | ||
68 | location @rewrite_no_slash { | 59 | location @rewrite_no_slash { |
69 | add_header rewrite no_slash; | 60 | add_header rewrite no_slash; |
@@ -74,6 +65,13 @@ server { | |||
74 | try_files $uri =404; | 65 | try_files $uri =404; |
75 | } | 66 | } |
76 | 67 | ||
68 | # RSS Feed for various names | ||
69 | # ref: https://blog.jim-nielsen.com/2021/feed-urls/ | ||
70 | location ~ ^/(rss|index.xml|atom|atom.xml|feed|feed.rss|feed.xml|feed.atom)$ { | ||
71 | alias /srv/http/feed.rss; | ||
72 | add_header Content-Type "text/xml; charset=utf-8"; | ||
73 | } | ||
74 | |||
77 | location ~ \.js$ { | 75 | location ~ \.js$ { |
78 | add_header Access-Control-Allow-Origin *; | 76 | add_header Access-Control-Allow-Origin *; |
79 | } | 77 | } |
@@ -244,7 +242,7 @@ server { | |||
244 | } | 242 | } |
245 | 243 | ||
246 | location ^~ /houshou { | 244 | location ^~ /houshou { |
247 | alias /home/pham/houshou/; | 245 | alias /home/pham/data/houshou/; |
248 | 246 | ||
249 | autoindex on; | 247 | autoindex on; |
250 | autoindex_format xml; | 248 | autoindex_format xml; |
@@ -256,14 +254,14 @@ server { | |||
256 | auth_basic_user_file /etc/nginx/passwd/houshou; | 254 | auth_basic_user_file /etc/nginx/passwd/houshou; |
257 | 255 | ||
258 | if ($uri ~ ([^/!]+)!(large|lg|md)$ ) { | 256 | if ($uri ~ ([^/!]+)!(large|lg|md)$ ) { |
259 | set $filename /home/pham/houshou/$1; | 257 | set $filename /home/pham/data/houshou/$1; |
260 | set $img_version $2; | 258 | set $img_version $2; |
261 | rewrite ^ /thumbnail; | 259 | rewrite ^ /thumbnail; |
262 | } | 260 | } |
263 | } | 261 | } |
264 | 262 | ||
265 | location ^~ /houshou2 { | 263 | location ^~ /houshou2 { |
266 | alias /home/pham/houshou2/; | 264 | alias /home/pham/data/houshou2/; |
267 | 265 | ||
268 | autoindex on; | 266 | autoindex on; |
269 | autoindex_format xml; | 267 | autoindex_format xml; |
@@ -273,7 +271,7 @@ server { | |||
273 | try_files $uri $uri/ =404; | 271 | try_files $uri $uri/ =404; |
274 | 272 | ||
275 | if ($uri ~ ([^/!]+)!(large|lg|md)$ ) { | 273 | if ($uri ~ ([^/!]+)!(large|lg|md)$ ) { |
276 | set $filename /home/pham/houshou2/$1; | 274 | set $filename /home/pham/data/houshou2/$1; |
277 | set $img_version $2; | 275 | set $img_version $2; |
278 | rewrite ^ /thumbnail; | 276 | rewrite ^ /thumbnail; |
279 | } | 277 | } |
@@ -341,7 +339,7 @@ server { | |||
341 | } | 339 | } |
342 | 340 | ||
343 | location = /logo.svg { | 341 | location = /logo.svg { |
344 | alias /home/pham/site/git/logo.svg; | 342 | alias /home/pham/site/git/assets/logo.svg; |
345 | } | 343 | } |
346 | 344 | ||
347 | # Configure HTTP transport | 345 | # Configure HTTP transport |