-
Notifications
You must be signed in to change notification settings - Fork 0
/
nginx.conf
executable file
·26 lines (23 loc) · 962 Bytes
/
nginx.conf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
server {
server_name localhost lt696dev.york.ac.uk maxfacts.uk maxfacts.york.ac.uk maxfacts.local localhost.maxfacts.uk;
client_max_body_size 2M;
location / {
# First attempt to serve request as file, then
# as directory, then fall back to displaying a 404.
# try_files $uri $uri/ =404;
# From tutorial at https://www.digitalocean.com/community/tutorials/how-to-set-up-a-node-js-application-for-production-on-ubuntu-16-04
proxy_pass http://app:3000;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection 'upgrade';
proxy_set_header Host $host;
proxy_cache_bypass $http_upgrade;
}
}
# Redirect from www to not-www
# From https://serverfault.com/questions/35955/how-to-get-nginx-to-redirect-from-www-to-non-www-domain
server {
server_name www.maxfacts.uk;
return 301 $scheme://maxfacts.uk$request_uri;
# permanent sends a 301 redirect whereas redirect sends 302 temp redirect
}