php - Running 2 domains on nginx doesn't work -
i've been struggling find solution few hours. have 1 node.js server running that's being redirected nginx , server i'm trying launch via normal way assigned 2nd domain. have 2 conf files in sites-enabled. 2nd domain redirects first
file 1 - node.js server port redirected
server { listen 80; server_name www.domain1.com domain1.com; location / { proxy_set_header x-real-ip $remote_addr; proxy_set_header host $http_host; proxy_pass http://vps-ip:2368; } } file 2 - php website
server { listen [::]:80; server_name www.domain2.pl domain2.pl; access_log /var/log/nginx/slucas.access.log; error_log /var/log/nginx/slucas.error.log; root /var/www2/dokuwiki; index doku.php; location ~ ^/(data|conf|bin|inc) { return 404; } location ~ ^/lib.*\.(gif|png|ico|jpg)$ { expires 31d; } location /tips { rewrite ^(.*)$ http://blog.slucas.fr/en$1 permanent; } location / { try_files $uri $uri/ @dokuwiki; } location @dokuwiki { rewrite ^/_media/(.*) /lib/exe/fetch.php?media=$1 last; rewrite ^/_detail/(.*) /lib/exe/detail.php?media=$1 last; rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_$1&id=$2 last; rewrite ^/tag/(.*) /doku.php?id=tag:$1&do=showtag&tag=tag:$1 last; rewrite ^/(.*) /doku.php?id=$1&$args last; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_param script_filename $document_root$fastcgi_script_name; fastcgi_pass unix:/tmp/fcgi.sock; } }
Comments
Post a Comment