Welcome! Log In Create A New Profile

Advanced

Can I create variables for things in the config file?

Posted by Akael 
Can I create variables for things in the config file?
October 03, 2011 10:14PM
I have a setup with multiple domains. and would like to use a variable to simplify this:


# setup rewriting rule to forward to www.sitname.com
server {
server_name sitename.com;
rewrite ^(.*) http://www.sitename.com$1 permanent;
}

server {
server_name www.sitename.com;
root /srv/vhosts/sitename.com/httpdocs;
access_log /srv/vhosts/sitename.com/logs/access.log;
error_log /srv/vhosts/sitename.com/logs/error.log;


Ideally I can create a variable to use in place of sitename.com

Is this possible?

Would the variable be reusable? (Can I reassign it later and use it with the new vaule?)

Thank you
Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 312
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready