Skip to content
sujitrsPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

7 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

Nginx

Installation

sudo apt update
sudo apt install nginx
sudo systemctl start nginx
sudo systemctl enable nginx

Configuration in static server


server {
    listen 80;
    server_name open-tech.in www.open-tech.in;

    root /var/www/pdf;
}

Configuration in reverse proxy

sudo nano /etc/nginx/sites-available/<<DOMAIN>>
sudo vi /etc/nginx/sites-available/<<DOMAIN>>
server {
    listen 80;
    listen [::]:80;
    server_name <<DOMAIN>> www.<<DOMAIN>>;
        location /<<RECEIVED-AS>> {
                proxy_pass <<FORWARD-TO>>;  # HTTP
                include proxy_params;

        }


}

server {
    listen 80;
    server_name example.com;

    location / {
        proxy_pass http://127.0.0.1:8080; # Forwards to your Java app or other service
        proxy_set_header Host $host;
        proxy_set_header X-Real-IP $remote_addr;
    }
}
sudo ln -s /etc/nginx/sites-available/<<DOMAIN>> /etc/nginx/sites-enabled/

Test config

sudo nginx -t

Restart nginx

sudo systemctl restart nginx

Install ssl via certbot

sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d <<DOMAIN>> -d www.<<DOMAIN>>

Renew ssl via certbot

sudo certbot renew --dry-run

tail -f /var/log/nginx/access.log

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors