We are happy to announce that Vesta is back under active development as of 25 February 2024. We are working on v1 candidate and expect to engage more with the community over the coming months. We are committed to open source, and we encourage contributors to help us build the future of Vesta.
Nginx + Apache - what is the correct admin config to stop /var/www
-
- Posts: 57
- Joined: Thu Apr 27, 2017 7:40 pm
- Os: Ubuntu 15x
- Web: apache + nginx
Nginx + Apache - what is the correct admin config to stop /var/www
I have struggled with this from day one and for the life of me have not managed to get this working at all.
The nginx.conf looks like this on the admin account:
The snginx.conf
The apache configs are defaults and all set /home/admin/web/marketers.coop/public_html correctly.
The problem I am having is that the https site works flawlessly, but the http site seems to be looking to /var/www/ instead of /home/admin/web/marketers.coop/. I tried creating a symlink between the directories but that creates a 500 error for some reason.
My site heavily relies on both http and https and they need to be able to pass sessions back and forth between the two (yes I know the security issues with this) so the files cannot be stored in two different locations, or the url's will be treated as completely different and the sessions passed between them will not maintain any variables.
Why is this defaulting the admin http account to /var/www but not the https? Is there an easy solution to this other than to install the site under a user account?
The nginx.conf looks like this on the admin account:
Code: Select all
server {
listen 192.227.210.138:80;
server_name marketers.coop www.marketers.coop *.marketers.coop;
error_log /var/log/apache2/domains/marketers.coop.error.log error;
location / {
proxy_pass http://192.227.210.138:8080;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/marketers.coop/public_html;
access_log /var/log/apache2/domains/marketers.coop.log combined;
access_log /var/log/apache2/domains/marketers.coop.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/marketers.coop/document_errors/;
}
location @fallback {
proxy_pass http://192.227.210.138:8080;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/admin/conf/web/nginx.marketers.coop.conf*;
}
Code: Select all
server {
listen 192.227.210.138:443;
server_name marketers.coop www.marketers.coop *.marketers.coop;
ssl on;
ssl_certificate /home/admin/conf/web/ssl.marketers.coop.pem;
ssl_certificate_key /home/admin/conf/web/ssl.marketers.coop.key;
error_log /var/log/apache2/domains/marketers.coop.error.log error;
location / {
proxy_pass https://192.227.210.138:8443;
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|tif|tiff|css|js|ttf|otf|webp|woff|txt|csv|rtf|doc|docx|xls|xlsx|ppt|pptx|odf|odp|ods|odt|pdf|psd|ai|eot|eps|ps|zip|tar|tgz|gz|rar|bz2|7z|aac|m4a|mp3|mp4|ogg|wav|wma|3gp|avi|flv|m4v|mkv|mov|mpeg|mpg|wmv|exe|iso|dmg|swf)$ {
root /home/admin/web/marketers.coop/public_html;
access_log /var/log/apache2/domains/marketers.coop.log combined;
access_log /var/log/apache2/domains/marketers.coop.bytes bytes;
expires max;
try_files $uri @fallback;
}
}
location /error/ {
alias /home/admin/web/marketers.coop/document_errors/;
}
location @fallback {
proxy_pass https://192.227.210.138:8443;
}
location ~ /\.ht {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
include /home/admin/conf/web/snginx.marketers.coop.conf*;
}
The problem I am having is that the https site works flawlessly, but the http site seems to be looking to /var/www/ instead of /home/admin/web/marketers.coop/. I tried creating a symlink between the directories but that creates a 500 error for some reason.
My site heavily relies on both http and https and they need to be able to pass sessions back and forth between the two (yes I know the security issues with this) so the files cannot be stored in two different locations, or the url's will be treated as completely different and the sessions passed between them will not maintain any variables.
Why is this defaulting the admin http account to /var/www but not the https? Is there an easy solution to this other than to install the site under a user account?
-
- Posts: 57
- Joined: Thu Apr 27, 2017 7:40 pm
- Os: Ubuntu 15x
- Web: apache + nginx
Re: Nginx + Apache - what is the correct admin config to stop /var/www
I finally found out the problem and I hope this helps others who may make the same mistake as I did.
So I was learning about tweaking the settings of nginx for performance reasons, and I changed some config files, specifically the caching pool.
I had changed the levels from 2 to 1,2 in /etc/nginx/conf.d/01_caching_pool.conf which created the issue.
So I was learning about tweaking the settings of nginx for performance reasons, and I changed some config files, specifically the caching pool.
I had changed the levels from 2 to 1,2 in /etc/nginx/conf.d/01_caching_pool.conf which created the issue.