Posted by
sapan
on
- Get link
- Other Apps
sudo apt update
sudo apt install nginx
sudo service nginx start
http://localhost
curl localhost
In both cases you will see nginx welcome page.
cd /etc/nginx/sites-available/
vi myapp
server {
listen 80;
server_name www.androidlearner.com androidlearner.com;
location /
{
proxy_pass http://localhost:5000;
# proxy_redirect off;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
}
location /backend/
{
proxy_pass http://localhost:3000/;
# proxy_redirect off;
# proxy_http_version 1.1;
# proxy_set_header Upgrade $http_upgrade;
# proxy_set_header Connection "upgrade";
# proxy_set_header Host $host;
}
}```
/etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/myapp /etc/nginx/sites-enabled/
sudo service nginx reload
Nginx is setup in the system.
Please ensure your firewall is properly setup
Comments
Post a Comment