-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy path3-app_server-nginx_config
41 lines (38 loc) · 1.38 KB
/
3-app_server-nginx_config
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
# /etc/nginx/sites-enabled/default
# the nginx configuration file
server {
listen 80 default_server;
listen [::]:80 default_server;
root /var/www/html;
index index.html index.htm index.nginx-debian.html;
server_name _;
add_header X-Served-By $hostname;
location / {
try_files $uri $uri/ =404;
}
location /redirect_me {
rewrite ^ https://youtube.com/watch?v=QH2-TGUlwu4 permanent;
}
location /hbnb_static/ {
alias /data/web_static/current;
index index.html;
}
location /airbnb-onepage/ {
proxy_pass http://localhost:5000;
proxy_set_header Host $http_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;
}
location ~ /airbnb-dynamic/number_odd_or_even/(\d+)$ {
proxy_pass http://localhost:5001/number_odd_or_even/$1;
proxy_set_header Host $http_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 /404.html;
location = /404.html {
internal;
}
}