Created
October 14, 2019 06:51
-
-
Save tippexs/ca10429f66901d00a6e6bd92278ab505 to your computer and use it in GitHub Desktop.
Nginx Config
This file contains hidden or 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
server { | |
listen 80; | |
server_name lev-fos-bayern.de www.lev-fos-bayern.de; | |
location / { | |
rewrite ^ https://www.lev-fos-bayern.de$request_uri? permanent; | |
} | |
location /.well-known/acme-challenge { | |
root /var/apphome/_nginx/acmechallenge; | |
default_type text/plain; | |
} | |
} | |
server { | |
listen 8888; | |
server_name localhost; | |
root /var/apphome/_customers/levfosbayern/wordpress; | |
index index.php; | |
location / { try_files $uri $uri/ /index.php?$args; } | |
location ~ [^/]\.php(/|$) { | |
fastcgi_pass unix:/var/run/php-fpm.sock; | |
fastcgi_intercept_errors off; | |
fastcgi_ignore_headers Cache-Control; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_buffers 16 16k; | |
fastcgi_buffer_size 32k; | |
} | |
} | |
server { | |
listen 443 ssl http2; | |
server_name lev-fos-bayern.de; | |
ssl_certificate /etc/nginx/ssl/live/www.lev-fos-bayern.de/fullchain.pem; | |
ssl_certificate_key /etc/nginx/ssl/live/www.lev-fos-bayern.de/privkey.pem; | |
ssl_protocols TLSv1.1 TLSv1.2; | |
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS'; | |
ssl_prefer_server_ciphers on; | |
fastcgi_param HTTPS on; | |
fastcgi_param HTTP_SCHEME https; | |
return 301 https://www.lev-fos-bayern.de$request_uri; | |
} | |
server { | |
listen 443 ssl http2; | |
server_name www.lev-fos-bayern.de; | |
ssl_certificate /etc/nginx/ssl/live/www.lev-fos-bayern.de/fullchain.pem; | |
ssl_certificate_key /etc/nginx/ssl/live/www.lev-fos-bayern.de/privkey.pem; | |
ssl_protocols TLSv1.1 TLSv1.2; | |
ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:DHE-RSA-AES256-GCM-SHA384:DHE-RSA-AES256-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-CAMELLIA256-SHA:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-RSA-SEED-SHA:DHE-RSA-CAMELLIA128-SHA:HIGH:!aNULL:!eNULL:!LOW:!3DES:!MD5:!EXP:!PSK:!SRP:!DSS'; | |
ssl_prefer_server_ciphers on; | |
fastcgi_param HTTPS on; | |
fastcgi_param HTTP_SCHEME https; | |
root /var/apphome/_customers/levfosbayern/wordpress; | |
index index.php; | |
gzip on; | |
gzip_types text/plain application/javascript application/x-javascript text/javascript text/xml text/css; | |
client_max_body_size 8M; | |
location / { | |
try_files $uri $uri/ /index.php?$args; | |
} | |
location = /favicon.ico { | |
log_not_found off; | |
access_log off; | |
} | |
location = /robots.txt { | |
allow all; | |
log_not_found off; | |
access_log off; | |
} | |
location ~* \.(ico|pdf|flv)$ { | |
expires 1y; | |
} | |
location ~* /mp-files/* { | |
proxy_pass http://localhost:8888; | |
proxy_set_header Host $host; | |
default_type application/pdf; | |
add_header Content-Type application/pdf; | |
} | |
location ~* \.(js|css|png|jpg|jpeg|gif|swf|xml|txt)$ { | |
expires 14d; | |
} | |
location ~* /(images|cache|media|logs|tmp)/.*\.(php|pl|py|jsp|asp|sh|cgi)$ { | |
return 403; | |
error_page 403 /403_error.html; | |
} | |
location ^~ /wp-content/uploads/mpdl/ { | |
return 401; | |
} | |
location ~ [^/]\.php(/|$) { | |
fastcgi_pass unix:/var/run/php-fpm.sock; | |
fastcgi_intercept_errors off; | |
fastcgi_ignore_headers Cache-Control; | |
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; | |
include /etc/nginx/fastcgi_params; | |
fastcgi_index index.php; | |
fastcgi_cache WORDPRESSLEVFOS; | |
fastcgi_buffers 16 16k; | |
fastcgi_buffer_size 32k; | |
fastcgi_cache_valid 200 720m; | |
fastcgi_cache_methods GET HEAD; | |
add_header X-Fastcgi-Cache $upstream_cache_status; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment