Skip to content

Commit bdeb062

Browse files
committed
5-app_server-nginx_config
1 parent 0c5bf25 commit bdeb062

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
server {
2+
listen 80 default_server;
3+
location /hbnb_static { alias /data/web_static/current/;}
4+
listen [::]:80 default_server;
5+
root /var/www/html;
6+
index index.html index.htm index.nginx-debian.html
7+
server_name_;
8+
add_header X-Served-By $hostname;
9+
location /static/ {
10+
# rewrite ^(/static/[^?]*)\?.*$ $1 last;
11+
alias /home/ubuntu/AirBnB_clone_v4/web_dynamic/static/;
12+
try_files $uri $uri/ =404;
13+
}
14+
location / {
15+
try_files $uri $uri/ =404;
16+
}
17+
location /airbnb-onepage {
18+
proxy_pass http://0.0.0.0:5000/airbnb-onepage;
19+
}
20+
location ~ ^/airbnb-dynamic/number_odd_or_even/([0-9]+)$ {
21+
proxy_pass http://0.0.0.0:5001/number_odd_or_even/$1;
22+
}
23+
location /api/ {
24+
proxy_pass http://0.0.0.0:5002;
25+
}
26+
if ($request_filename ~ redirect_me){
27+
rewrite ^ https://th3-gr00t.tk/ permanent;
28+
}
29+
error_page 404 /error_404.html;
30+
location = /error_404.html {
31+
internal;
32+
}
33+
}

0 commit comments

Comments
 (0)