Skip to content

Latest commit

 

History

History
42 lines (37 loc) · 1.29 KB

nginx.org

File metadata and controls

42 lines (37 loc) · 1.29 KB

This is nginx configuration file /etc/nginx/sites-available/chalaev.com and /etc/nginx/sites-enabled/chalaev.com

It tells nginx to forward all requests to chalaev.com to localhost:50001.

Forward www.chalaev.com to chalaev.com:

server {
        listen 80;
        listen  443 ssl;
        server_name www.chalaev.com;
        return 301 $scheme://chalaev.com$request_uri;
ssl_certificate     /etc/letsencrypt/live/chalaev.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chalaev.com/privkey.pem; # managed by Certbot
}

Forward all http requests to https:

server {
listen 80;
listen [::]:80;
server_name chalaev.com;
return 301 https://chalaev.com$request_uri; 
}
server {
listen  443 ssl;
server_name chalaev.com;
ssl_certificate     /etc/letsencrypt/live/chalaev.com/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/chalaev.com/privkey.pem; # managed by Certbot

Compiled binary (see Makefile) is listening on 50001th port:

location / {
proxy_pass http://localhost:50001;
}}