diff --git a/v2-varnish/WordPress/WordPress b/v2-varnish/WordPress/WordPress index 919f696..bc1f6e3 100644 --- a/v2-varnish/WordPress/WordPress +++ b/v2-varnish/WordPress/WordPress @@ -1,28 +1,10 @@ #{"rootDirectory":"","phpVersion":"8.0"} server { - listen 80; - listen [::]:80; - listen 443 ssl http2; - listen [::]:443 ssl http2; - {{ssl_certificate_key}} - {{ssl_certificate}} + listen 8080; + listen [::]:8080; {{server_name}} {{root}} - {{nginx_access_log}} - {{nginx_error_log}} - - if ($scheme != "https") { - rewrite ^ https://$host$uri permanent; - } - - location ~ /.well-known { - auth_basic off; - allow all; - } - - {{settings}} - try_files $uri $uri/ /index.php?$args; index index.php index.html; @@ -45,6 +27,59 @@ server { access_log off; } + if (-f $request_filename) { + break; + } +} + +server { + listen 80; + listen [::]:80; + listen 443 ssl http2; + listen [::]:443 ssl http2; + {{ssl_certificate_key}} + {{ssl_certificate}} + {{server_name}} + {{root}} + + {{nginx_access_log}} + {{nginx_error_log}} + + if ($scheme != "https") { + rewrite ^ https://$host$uri permanent; + } + + location ~ /.well-known { + auth_basic off; + allow all; + } + + {{settings}} + + location / { + proxy_pass http://127.0.0.1:6081; + #proxy_pass http://127.0.0.1:8080; + proxy_set_header Host $http_host; + proxy_set_header X-Forwarded-Host $http_host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_redirect off; + proxy_max_temp_file_size 0; + proxy_connect_timeout 720; + proxy_send_timeout 720; + proxy_read_timeout 720; + proxy_buffer_size 128k; + proxy_buffers 4 256k; + proxy_busy_buffers_size 256k; + proxy_temp_file_write_size 256k; + } + + location ~* ^.+\.(css|js|jpg|jpeg|gif|png|ico|gz|svg|svgz|ttf|otf|woff|woff2|eot|mp4|ogg|ogv|webm|webp|zip|swf)$ { + add_header Access-Control-Allow-Origin "*"; + expires max; + access_log off; + } + if (-f $request_filename) { break; }