Answer the question
In order to leave comments, you need to log in
How to make Apache2 return ServerName correctly?
Good afternoon, connoisseurs!
The problem is the following, there are 2 sites on the VPS, site1.ru and site2.ru
site1.ru - on https, site2.ru - no.
apache2 settings for websites:
<VirtualHost localhost:81>
ServerName site1.ru
ServerAlias www.site1.ru mirror.site1.ru
ServerAdmin ****@gmail.com
DocumentRoot /var/www/site1.ru
<Directory "/var/www/site1.ru">
AllowOverride All
Options +Includes
</Directory>
</VirtualHost>
<VirtualHost localhost:81>
ServerName site2.ru
ServerAlias www.site2.ru
ServerAdmin ****@gmail.com
DocumentRoot /var/www/site2.ru
<Directory "/var/www/site2.ru">
AllowOverride All
Options +Includes
</Directory>
</VirtualHost>
server {
listen 80;
root /var/www/site1.ru;
server_name site1.ru www.site1.ru;
index index.php index.html;
location ~* ^(?!/img/|/upload/map/).+\.(jpg|jpeg|gif|png|ico|css|zip|tgz|gz|js)$ {
access_log off;
expires 30d;
}
location / {
proxy_pass http://localhost:81;
}
location ~ /\.ht {
deny all;
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question