hi, thanks for the reply.
but i wanted this to be applied for all the domain added on myvestacp using a specific template.
Note: i'm doing domain addition through api.
but here is the list of things i did so far.
created
2 files on /usr/local/vesta/data/templates/web/nginx/
1. reverse-force-https.tpl ( clone of force-https.tpl ) - no changes done.
2. reverse-force-https.stpl - clone of force-https.stpl and added proxy_header addition.
here is the code of reverse-force.stpl
Code: Select all
server {
listen %ip%:%proxy_ssl_port% ssl http2;
server_name %domain_idn% %alias_idn%;
ssl_certificate %ssl_pem%;
ssl_certificate_key %ssl_key%;
error_log /var/log/%web_system%/domains/%domain%.error.log error;
location / {
proxy_pass https://%ip%:%web_ssl_port%;
proxy_set_header Host %domain%.actor.com;
location ~* ^.+\.(%proxy_extentions%)$ {
root %sdocroot%;
access_log /var/log/%web_system%/domains/%domain%.log combined;
access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
expires max;
# try_files $uri @fallback;
}
}
location /error/ {
alias %home%/%user%/web/%domain%/document_errors/;
}
location @fallback {
proxy_pass https://%ip%:%web_ssl_port%;
}
location ~ /\.ht {return 404;}
location ~ /\.env {return 404;}
location ~ /\.svn/ {return 404;}
location ~ /\.git/ {return 404;}
location ~ /\.hg/ {return 404;}
location ~ /\.bzr/ {return 404;}
disable_symlinks if_not_owner from=%docroot%;
include %home%/%user%/conf/web/*nginx.%domain_idn%.conf_letsencrypt;
include %home%/%user%/conf/web/s%proxy_system%.%domain%.conf*;
}
on location / , i'am added proxy_header
proxy_set_header Host %domain%.actor.com;
but after adding domain i was expecting a value of domain name without suffix on web config generated,
so if i add
testing.com domain, the proxy header should be
proxy_set_header Host testing.actor.com;
but what i get is
proxy_set_header Host testing.com.actor.com;
do we have something like
php explode %domain% and get first array value.
so i can simply replace %domain% with that ?
Thanks.