Answer the question
In order to leave comments, you need to log in
How to make a config for two sites?
The first site should be on a subdomain, and next to it should be a landing page (one index.html) site on the main domain.
The config now looks like this:
server {
listen 81;
server_name example.example.com;
access_log /var/log/nginx/example.log;
location /static/ {
root /opt/myenv/example_dir;
expires 30d;
}
location / {
proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $server_name;
proxy_set_header X-Real_IP remote_addr;
proxy_set_header X-Forwarded-Proxy $proxy_add_x_forwarded_proxy;
}
}
server {
listen 80;
server_name example.com;
location / {
root /opt/myenv/example_dir_2;
index index.html;
}
}
Answer the question
In order to leave comments, you need to log in
well, for starters, write everything you need into the second server, otherwise there you have some kind of emptiness and dullness in general;)
server {
server_name www.lorena-salon.ru;
access_log /var/log/ispconfig/httpd/$host/access.log;
location / {
index index.php index.html index.htm;
root /var/www/lorena-salon.ru/web/;
proxy_pass http://www.lorena-salon.ru:82;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
server {
server_name www.kredo-m.ru;
access_log /var/log/ispconfig/httpd/$host/access.log;
location / {
index index.php index.html index.htm;
root /var/www/kredo-m.ru/web/;
proxy_pass http://www.kredo-m.ru:82;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question