Note that there are some explanatory texts on larger screens.

plurals
  1. PONginx and subdomains
    primarykey
    data
    text
    <p>I'm trying to getting started with nginx. But I cant really understand what's going wrong with this code.</p> <p>As you can see there are 2 domains:</p> <ol> <li>mauromarano.it</li> <li>dev.mauromarano.it</li> </ol> <p>The first domains hosts a wordpress blog.</p> <pre><code>##################### # mauromarano.it/ # #################### server { listen 80; # listen [::]:80 default_server; root /usr/share/nginx/mauromarano.it/public_html; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name mauromarano.it www.mauromarano.it; access_log /usr/share/nginx/mauromarano.it/logs/access.log; error_log /usr/share/nginx/mauromarano.it/logs/error.log; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /blog { try_files $uri $uri/ /blog/index.php?$args; } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(/blog)(/.*)$; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/mauromarano.it/public_html$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } } ##################### # mauromarano.com # #################### server { listen 80; # listen [::]:80 default_server; root /usr/share/nginx/mauromarano.com/public_html; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name mauromarano.com www.mauromarano.com; access_log /usr/share/nginx/mauromarano.com/logs/access.log; error_log /usr/share/nginx/mauromarano.com/logs/error.log; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/mauromarano.com/public_html$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } } ##################### # dev.mauromarano.it/ # #################### server { listen 80; # listen [::]:80 default_server; root /usr/share/nginx/dev.mauromarano.it/public_html; index index.html index.htm index.php; # Make site accessible from http://localhost/ server_name dev.mauromarano.it www.dev.mauromarano.it; access_log /usr/share/nginx/dev.mauromarano.it/logs/access.log; error_log /usr/share/nginx/dev.mauromarano.it/logs/error.log; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. try_files $uri $uri/ /index.html; # Uncomment to enable naxsi on this location # include /etc/nginx/naxsi.rules } location /doc/ { alias /usr/share/doc/; autoindex on; allow 127.0.0.1; allow ::1; deny all; } location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_split_path_info ^(/blog)(/.*)$; fastcgi_param SCRIPT_FILENAME /usr/share/nginx/dev.mauromarano.it/public_html$fastcgi_script_name; fastcgi_index index.php; include fastcgi_params; } } </code></pre> <p>Where I'm wrong?</p> <p>My goal Is to having this two domains working. But in this way, the subdomains (dev.mauromarano.it) is not working.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload