-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(objectstorage): web host add history router support (#5076)
* feat(objectstorage): web host add history router support * ok * ok * ok
- Loading branch information
Showing
3 changed files
with
73 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
frontend/providers/objectstorage/src/templates/nginx/site-host
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
user nginx; | ||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log notice; | ||
pid /var/run/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
proxy_intercept_errors on; | ||
|
||
server { | ||
listen 80; | ||
location / { | ||
rewrite ^/404\.html$ /<%= bucket %>/404.html break; | ||
rewrite ^/$ /<%= bucket %>/index.html break; | ||
rewrite ^/(.+)/$ /<%= bucket %>/$1/index.html break; | ||
rewrite ^/(.+)$ /<%= bucket %>/$1 break; | ||
proxy_pass http://object-storage.objectstorage-system.svc.cluster.local; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | ||
proxy_set_header X-Forwarded-Proto $scheme; | ||
error_page 404 = @spa; | ||
} | ||
|
||
location @spa { | ||
rewrite ^(.*)$ /<%= bucket %>/index.html break; | ||
proxy_pass http://object-storage.objectstorage-system.svc.cluster.local; | ||
} | ||
|
||
location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|woff|woff2|ttf|eot|json)$ { | ||
rewrite ^/(.+)$ /<%= bucket %>/$1 break; | ||
proxy_pass http://object-storage.objectstorage-system.svc.cluster.local; | ||
proxy_set_header Host $host; | ||
proxy_set_header X-Real-IP $remote_addr; | ||
expires max; | ||
log_not_found off; | ||
} | ||
} | ||
|
||
sendfile on; | ||
} |