-
Notifications
You must be signed in to change notification settings - Fork 7
/
nginx.conf
58 lines (48 loc) · 1.35 KB
/
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
# Redirect www to non-www
# https://stackoverflow.com/a/11733363
server {
listen 80;
listen 443 ssl;
server_name www.chaidarun.com;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
return 301 https://chaidarun.com$request_uri;
}
# Redirect http to https
server {
listen 80;
listen [::]:80;
server_name chaidarun.com;
return 301 https://$server_name$request_uri;
}
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
ssl_certificate /etc/ssl/cert.pem;
ssl_certificate_key /etc/ssl/key.pem;
server_name chaidarun.com;
root /var/www/html;
index index.html;
# Redirect .html to non-.html
# https://stackoverflow.com/a/58747268
location ~ ^/(.*)\.html$ {
return 301 https://$host/$1;
}
# Serve .html as non-.html
location / {
try_files $uri $uri.html $uri/index.html =404;
}
location /isso {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Script-Name /isso;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://localhost:8080;
}
rewrite ^/about$ / permanent;
rewrite ^/cv$ /files/ArtChaidarun-WebResume.pdf redirect;
rewrite ^/home$ / permanent;
rewrite ^/resume$ /files/ArtChaidarun-WebResume.pdf redirect;
rewrite ^/software-i-use$ /apps-i-use permanent;
error_page 404 /404.html;
}