vlijmenlive
Verified User
Hi everyone,
I've been running nginx_reverse for quite some time now and it all goes perfect. But since a few days I have a website running that has a lot of visitors, so I thought some improvements could be made to serve static content. I don't want to loose Apache completely due to site setup, but I do know all images can be processed directly from their location.
1. Do I have to setup anything at all to let Nginx processes them directly instead of proxy the request to apache?
2. I thought I would have to added something to the domains config, I thought about a CUSTOM3 token in the nginx file. I tried this:
Now I do get the header returned that says OK. But is it really OK or did I just manage to output an extra header? I tried to search for log entries but I'm not sure where I can check to make sure it works.
3. Is my code correct, and will this also proxy the request correctly to apache if the file was not found?
I guess there are people here with more experience in Nginx config then I do at the moment, so if someone would be able to help me out that would be great. A different solution is also ok of course.
Kind regards,
Niels
I've been running nginx_reverse for quite some time now and it all goes perfect. But since a few days I have a website running that has a lot of visitors, so I thought some improvements could be made to serve static content. I don't want to loose Apache completely due to site setup, but I do know all images can be processed directly from their location.
1. Do I have to setup anything at all to let Nginx processes them directly instead of proxy the request to apache?
2. I thought I would have to added something to the domains config, I thought about a CUSTOM3 token in the nginx file. I tried this:
Code:
location ~* \.(ico|gif|jpe?g|png)$ {
try_files $uri $uri/ /$uri;
add_header X-Test-Nginx-Bypass "OK";
expires 15m;
}
Now I do get the header returned that says OK. But is it really OK or did I just manage to output an extra header? I tried to search for log entries but I'm not sure where I can check to make sure it works.
3. Is my code correct, and will this also proxy the request correctly to apache if the file was not found?
I guess there are people here with more experience in Nginx config then I do at the moment, so if someone would be able to help me out that would be great. A different solution is also ok of course.
Kind regards,
Niels