Created
April 9, 2018 18:56
-
-
Save sebastian13/dac1cc22b976cc235461c28877fa10ae to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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