Hi all,
I recently got myself a new VPS with directadmin. We decided to go with nginx + apache and php-fpm. So far so good. Now I've been reading up on to nginx configuration and I need to ask something. Is it just me or does the default configuration just forward everything to apache? I thought the whole point was that static files could be loaded faster by nginx and the rest get's shipped of to apache?
This is what I see when I click on 'nginx proxy' under 'Custom HTTPD Configurations':
Won't something like this be better? Or am I missing something?
If I'm correct, when I want to use nginx now I need to call my files with 'domain.com/nginx_static_files/file.png' for example?
I recently got myself a new VPS with directadmin. We decided to go with nginx + apache and php-fpm. So far so good. Now I've been reading up on to nginx configuration and I need to ask something. Is it just me or does the default configuration just forward everything to apache? I thought the whole point was that static files could be loaded faster by nginx and the rest get's shipped of to apache?
This is what I see when I click on 'nginx proxy' under 'Custom HTTPD Configurations':
Code:
location /
{
# access_log off;
proxy_buffering off;
proxy_pass http://46.249.53.100:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /nginx_static_files/
{
# access_log /var/log/nginx/access_log_proxy;
alias /home/site03/domains/buggedbrain.com/public_html/;
internal;
}
include /etc/nginx/webapps.conf;
Won't something like this be better? Or am I missing something?
Code:
location /
{
try_files $uri $uri/ @backend;
}
location @backend {
# access_log off;
proxy_buffering off;
proxy_pass http://46.249.53.100:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location ~ \.php {
# access_log off;
proxy_buffering off;
proxy_pass http://46.249.53.100:8080;
proxy_set_header X-Client-IP $remote_addr;
proxy_set_header X-Accel-Internal /nginx_static_files;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
include /etc/nginx/webapps.conf;
If I'm correct, when I want to use nginx now I need to call my files with 'domain.com/nginx_static_files/file.png' for example?