I created a user and website and database via v-* scripts, then proceeded to import data from another server (copying files via sftp and restoring .sql files via mysql). When researching my other problem I found that the nginx config is different for those that are created this way versus those that were created fully in the interface and used the “install application/wordpress” option.
Here’s one created through the interface on the current version:
#=======================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#
server {
listen 10.10.20.14:80;
server_name newtest.wsu01.matice.com ;
root /home/newtest/web/newtest.wsu01.matice.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/newtest.wsu01.matice.com.log combined;
access_log /var/log/nginx/domains/newtest.wsu01.matice.com.bytes bytes;
error_log /var/log/nginx/domains/newtest.wsu01.matice.com.error.log error;
include /home/newtest/conf/web/newtest.wsu01.matice.com/nginx.forcessl.conf*;
location / {
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/run/php/php7.4-fpm-newtest.wsu01.matice.com.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location /error/ {
alias /home/newtest/web/newtest.wsu01.matice.com/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias /home/newtest/web/newtest.wsu01.matice.com/stats/;
include /home/newtest/web/newtest.wsu01.matice.com/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /home/newtest/conf/web/newtest.wsu01.matice.com/nginx.conf_*;
}
And here’s the one created via scripts about a week ago (so last version?):
#=======================================================================#
# Default Web Domain Template #
# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
#=======================================================================#
server {
listen 10.10.20.14:80;
server_name somewebsite.com www.somewebsite.com;
root /home/webs/web/somewebsite.com/public_html;
index index.php index.html index.htm;
access_log /var/log/nginx/domains/somewebsite.com.log combined;
access_log /var/log/nginx/domains/somewebsite.com.bytes bytes;
error_log /var/log/nginx/domains/somewebsite.com.error.log error;
include /home/webs/conf/web/somewebsite.com/nginx.forcessl.conf*;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / {
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
location ~* ^.+\.(jpeg|jpg|png|gif|bmp|ico|svg|css|js)$ {
expires max;
fastcgi_hide_header "Set-Cookie";
}
location ~ [^/]\.php(/|$) {
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
if (!-f $document_root$fastcgi_script_name) {
return 404;
}
fastcgi_pass unix:/run/php/php7.4-fpm-somewebsite.com.sock;
fastcgi_index index.php;
include /etc/nginx/fastcgi_params;
}
}
location /error/ {
alias /home/webs/web/somewebsite.com/document_errors/;
}
location ~* "/\.(htaccess|htpasswd)$" {
deny all;
return 404;
}
location /vstats/ {
alias /home/webs/web/somewebsite.com/stats/;
include /home/webs/web/somewebsite.com/stats/auth.conf*;
}
include /etc/nginx/conf.d/phpmyadmin.inc*;
include /etc/nginx/conf.d/phppgadmin.inc*;
include /etc/nginx/conf.d/webmail.inc*;
include /home/webs/conf/web/somewebsite.com/nginx.conf_*;
}
The following items are missing from the file created via the web interface. Is this just an update to the template? Is there a reason for this change and should I fix all my old nginx.conf templates?
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location / { <=== line not changed but shown for reference
try_files $uri $uri/ /index.php?$args;
if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}