45 lines
1.5 KiB
Plaintext
45 lines
1.5 KiB
Plaintext
|
|
#make sure in nginx.conf has include module.d/*.conf inside http block one.
|
|
server {
|
|
listen 80; #make nginx out side listen 82;
|
|
location /familytreeapi/ {
|
|
#proxy_pass http://127.0.0.1:5015;
|
|
proxy_pass http://192.168.1.219:5015/;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection keep-alive;
|
|
proxy_set_header Host $host;
|
|
proxy_cache_bypass $http_upgrade;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
|
|
location / {
|
|
return 301 /familytreeui/; #if same one redirect to /familytreeui/
|
|
}
|
|
|
|
location /familytreeui {
|
|
return 301 /familytreeui/; #if same one redirect to /familytreeui/
|
|
}
|
|
|
|
location /familytreeui/ {
|
|
#root /var/www/familytree/; #path is real must exist like /var/www/familytree/familytreeui and /var/www/familytree/api folder.
|
|
alias /var/www/familytree/ui/; #location does not to match. but angular index baseurl must same as location.
|
|
#index index.html;
|
|
try_files $uri $uri/ /familytreeui/index.html /index.html;
|
|
}
|
|
|
|
|
|
# Optional: Cache static assets for better performance
|
|
#location ~* \.(?:ico|css|js|gif|jpe?g|png)$ {
|
|
# expires 30d;
|
|
# add_header Cache-Control "public";
|
|
#}
|
|
|
|
# error_page 404 /index.html;
|
|
|
|
# put in /etc/nginx/sites-availalble/familytreeapp.conf
|
|
# link to enable
|
|
# $) sudo ln -s /etc/nginx/sites-availalble/familytreeapp.conf /etc/nginx/sites-enabled/
|
|
}
|