moving to environment variables
This commit is contained in:
50
nginx/nginx.conf.template
Normal file
50
nginx/nginx.conf.template
Normal file
@@ -0,0 +1,50 @@
|
||||
events {
|
||||
worker_connections 1024;
|
||||
}
|
||||
|
||||
http {
|
||||
server_tokens off;
|
||||
charset utf-8;
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name adam-french.co.uk www.adam-french.co.uk;
|
||||
|
||||
# Allow Certbot to access the ACME challenge
|
||||
location /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
# Redirect everything else to HTTPS
|
||||
location / {
|
||||
return 301 https://$host$request_uri;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 443 ssl http2;
|
||||
ssl_certificate /etc/letsencrypt/live/adam-french.co.uk/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/adam-french.co.uk/privkey.pem;
|
||||
|
||||
server_name adam-french.co.uk;
|
||||
|
||||
location ~ /.well-known/acme-challenge/ {
|
||||
root /var/www/certbot;
|
||||
}
|
||||
|
||||
location = /posts {
|
||||
return 301 /posts/;
|
||||
}
|
||||
|
||||
location /posts/ {
|
||||
proxy_pass http://$BACKEND_HOST:8080/posts;
|
||||
proxy_set_header Host $host;
|
||||
proxy_set_header X-Real-IP $remote_addr;
|
||||
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||||
proxy_set_header X-Forwarded-Proto $scheme;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user