Skip to content

Instantly share code, notes, and snippets.

@chrfs
Last active December 26, 2018 12:10
Show Gist options
  • Save chrfs/8d8ea7d284bcc42055a6ba18c04aeccf to your computer and use it in GitHub Desktop.
Save chrfs/8d8ea7d284bcc42055a6ba18c04aeccf to your computer and use it in GitHub Desktop.
Prestashop Docker NGINX Configuration for a NGINX-Reverse-Proxy
server {
listen 80;
server_name shop-domain.com;
# Proxy for ACME-Challenges
location ^~ /.well-known/acme-challenge {
allow all;
proxy_pass http://acme-upstream$uri;
}
# Redirect to TLS supported connection
location / {
rewrite ^ https://$host$request_uri? permanent;
}
}
server {
# ssl/http2 activated
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name shop-domain.com;
server_tokens off;
# TLS certificates
ssl_certificate certs/live/shop-domain.com/fullchain.pem;
ssl_certificate_key certs/live/shop-domain.com/privkey.pem;
# TLS configurations
include conf.d/ssl.conf_;
# Security headers
include conf.d/headers.conf_;
location / {
# Specific headers depending on your service could cause a 502 Bad Gateway or a slow connection
# proxy_set_header X-Real-IP $remote_addr;
# proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# proxy_set_header Host $host;
# proxy_set_header X-NginX-Proxy true;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto https;
proxy_redirect off;
proxy_pass http://docker-shop-container:80/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment