server { listen 80; listen [::]:80; # listen 8443 ssl; # listen [::]:8443 ssl; # ssl_certificate /etc/nginx/ssl/server.crt; # ssl_certificate_key /etc/nginx/ssl/server.key; root /app; index index.php index.html; location / { rewrite ^/(.*)$ /public/$1 last; } location /public { rewrite ^/public/(.*)$ /public/index.php?url=$1 last; } location ~ ^/public/.+\.php$ { fastcgi_pass php-fpm-frntnd-svc:9000; include fastcgi.conf; } location ~ ^(/public/|/).*\.(browserslistrc|css|editorconfig|eot|eslintignore|fla|gif|gitattributes|ico|jpeg|jpg|js|json|less|lock|map|md|npmignore|nuspec|otf|png|ps1|psd|scss|stylelintignore|stylelintrc|svg|swf|tgz|ttf|txt|wav|webp|woff|woff2|xml|yaml|yml|zip)$ { expires max; try_files /$1$uri /public/$1$uri $uri =404; } }