Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save sebastian13/dac1cc22b976cc235461c28877fa10ae to your computer and use it in GitHub Desktop.
Save sebastian13/dac1cc22b976cc235461c28877fa10ae to your computer and use it in GitHub Desktop.
map $http_accept_language $lang {
default en;
~*^de de;
~*^en en;
}
server {
listen 80;
listen [::]:80;
server_name example.com;
location / {
return 301 https://$host$request_uri;
}
}
server {
server_name example.com;
listen 443 ssl http2 ;
ssl_certificate /etc/nginx/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/nginx/letsencrypt/live/example.com/privkey.pem;
location ~ ^/(en|de|wp-content|wp-includes|wp-admin|favixon.ico)/ {
resolver 127.0.0.11 valid=30s;
set $wordpress wordpress_1:80;
proxy_pass http://$wordpress;
}
location / {
return 302 $lang$request_uri;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment