I have HTTPS redirect in nginx.conf
But if the requested URI is HTTP and 404 - I don't need a redirect. Is there any solution for this specific configuration?
Also is there a possibility to turn off HTTPS + www redirect for 404 links like http://www.test.com
If point 1 or 2 cannot be done, can I hardcode a list of 404 URLs with nginx to completely turn off any redirect for them and only show 404 page? (HTTPS and www)
WordPress + Nginx (+Vestacp)
server {
listen x.x.x.x:80;
server_name test.com www.test.com;
root /home/admin/web/test.com/web/;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/test.com.log combined;
access_log /var/log/nginx/domains/test.com.bytes bytes;
error_log /var/log/nginx/domains/test.com.error.log error;
return 301 https://test.com$request_uri;
}