Skip to content

Commit

Permalink
[Add] nginx config to include improvements for server side hosting an…
Browse files Browse the repository at this point in the history
…d adding no-caching
  • Loading branch information
samatrhea committed Feb 22, 2024
1 parent fb38586 commit 7228997
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
1 change: 1 addition & 0 deletions COMETwebapp.sln
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
CODE_OF_CONDUCT.md = CODE_OF_CONDUCT.md
LICENSE = LICENSE
LICENSE-APACHE 2.0 = LICENSE-APACHE 2.0
nginx = nginx
NOTICE = NOTICE
Nuget.Config = Nuget.Config
README.md = README.md
Expand Down
34 changes: 34 additions & 0 deletions nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
map $http_connection $connection_upgrade {
"~*Upgrade" $http_connection;
default keep-alive;
}

server {
server_name comet-web.cdp4.org;

location / {
proxy_pass http://127.0.0.1:8086;

# Configuration for WebSockets
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection $connection_upgrade;
proxy_cache off;

# WebSockets were implemented after http/1.0
proxy_http_version 1.1;

# Configuration for LongPolling or if your KeepAliveInterval is longer than 60 seconds
proxy_read_timeout 100s;

proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;

# kill cache
add_header Last-Modified $date_gmt;
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0';
if_modified_since off;
expires off;
etag off;
}
}

0 comments on commit 7228997

Please sign in to comment.