deyatinor: (с биноклем)
[personal profile] deyatinor
Я хочу настроить два виртуальных хоста. Поставила nginx+Apache (нужны оба, т.к. один виртуальный хост - рабочий, а там это обязательное требование).

Apache
listen.conf
-------------------
Listen 8080
Listen 8001

NameVirtualHost *

default-vhost.conf
-------------------

    ServerName dummy-host.example.com
    ServerAdmin webmaster@dummy-host.example.com
    ServerAlias example.com www.example.com

    DocumentRoot "/srv/www/htdocs"

    ErrorLog /var/log/apache2/dummy-host.example.com-error_log
    CustomLog /var/log/apache2/dummy-host.example.com-access_log combined

    HostnameLookups Off

    UseCanonicalName Off

    ServerSignature On

    ScriptAlias /cgi-bin/ "/srv/www/cgi-bin/"
 
    AllowOverride None
    Options +ExecCGI -Includes
    Order allow,deny
    Allow from all
   
  
    UserDir public_html
    Include /etc/apache2/mod_userdir.conf


    Options +Indexes +MultiViews +FollowSymLinks
    IndexOptions FancyIndexing
    AllowOverride None
    Order allow,deny
    Allow from all
   

    ServerName to.local
    ServerAlias www.to.local js.goto.local css.goto.local img.goto.local www.js.goto.local www.css.goto.local www.img.goto.local
    DocumentRoot /srv/www/htdocs/Lightsoft/www


    ServerName imsosap.local
    ServerAlias www.imsosap.local
    DocumentRoot /home/regina/htdocs/imsosap


httpd.conf
------------------------
включён оверрайд для корня и всё

Nginx
nginx.conf
------------------------
http {
    include       mime.types;
    default_type  application/octet-stream;

    sendfile        on;

    keepalive_timeout  65;

    include conf.d/*.conf;

    server {
        listen       80;
        server_name  www.to.local to.local css.goto.local js.goto.local img.goto.local www.css.goto.local www.js.goto.local www.img.goto.local stat.tophotel.local;
        root /srv/www/htdocs/Lightsoft/www;

        location / {
            proxy_pass http://127.0.0.1:8080;
            index  index.html index.htm;
            ssi on;
        }
        location ~* (.*)-version-(\d+)\.(jpg|jpeg|gif|png|js|css|txt|htm)$ {
            charset windows-1251;
            access_log off;
            rewrite ^(.*)-version-(\d+)\.(jpg|jpeg|gif|png|js|css|txt|htm)$ $1.$3 break;
        }
        location ~* ^/js/a/(.*)-version-(\d+)\.(jpg|jpeg|gif|png|js|css|txt|htm)$ {
            charset windows-1251;
            alias /home/regina/Lightsoft/webhome/js/$1.$3;
            access_log off;
        }
        location /js/a/ {
            charset windows-1251;
            alias /home/regina/Lightsoft/webhome/js/;
            access_log off;
        }
        location /js/ {
            charset windows-1251;
            access_log off;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   /srv/www/htdocs/;
        }
    }
    server {
        listen 8000;
        server_name imsosap.local www.imsosap.local;
        root /home/regina/htdocs/imsosap;

        location / {
        root /home/regina/htdocs/imsosap;
            proxy_pass http://127.0.0.1:8001;
            index index.html index.htm;      
        }

    location ~ \.php$ {
        proxy_pass http://127.0.0.1:8001;
        }
    }
    include vhosts.d/*.conf;
}

В /etc/hosts прописан алиас 127.0.0.1 на to.local

Почему у меня работает только to.local, а imsosap.local не работает? Он или перенаправляет запросы на to.local, или просто ничего не отдаёт. Я и по порту обращалась и как угодно, а оно всё равно не работает.
This account has disabled anonymous posting.
If you don't have an account you can create one now.
No Subject Icon Selected
More info about formatting

March 2020

S M T W T F S
1 234567
891011121314
15161718192021
22232425262728
293031    

Style Credit

Expand Cut Tags

No cut tags
Page generated Jul. 25th, 2025 03:40 am
Powered by Dreamwidth Studios