curious .conf problem

David27 nginx-forum at forum.nginx.org
Fri Jan 7 18:46:06 UTC 2022


Hello Francis, 

>  If you have no "server_name www.thomas-walker-lynch.com;" (

There is indeed a server block already defined with a server name
www.thomas-walker-lynch.com.  Nginx just chooses to use a different block
that has a different server name.  (Or perhaps I messed up the syntax for it
lol)   Note that everything else seems to be working. 

As for copying *everything* into the email ...  1) I thought folks would
rather see the entire files rather than quotes from them, so I provided txt
links.  Did the link not work for you? 2) Gosh  I am also hesitant to put
the entire sites .conf file in a public email list where for evermore they
are viewable by people who might notice exploits, even those unrelated to
the issue at hand.  Well in any case, find the entire .conf file for the
second virtual host below.  

Also
Here is a detailed description of the problem:
thomaswlynch.com/conf/info.txt

This is the .conf file used for the main website (which is working).  It is
the only other .conf file currently in sites-enabled
thomaswlynch.com/conf/customer_gateway.txt

This is the .conf file for the second host, which has the problem:
thomaswlynch.com/conf/thomas-walker-lynch.txt   

The following is the .conf file found at the above link:

server {
  server_name .thomaswlynch.com;
  return 301 https://thomas-walker-lynch.com$request_uri;
}

server {
  server_name .thomaswalkerlynch.com;
  return 301 https://thomas-walker-lynch.com$request_uri;
}

server {
  server_name www.thomas-walker-lynch.com;
  return 301 https://thomas-walker-lynch.com$request_uri;
}

server {
  server_name thomas-walker-lynch.com;
  listen 80;
  listen [::]:80;
  return 301 https://thomas-walker-lynch.com$request_uri;
}

server {
  server_name thomas-walker-lynch.com
  charset utf-8;
  listen [::]:443 ssl;
  listen 443 ssl;
  access_log /var/log/nginx/thomas-walker-lynch.com_access.log;
  error_log /var/log/nginx/thomas-walker-lynch.com_error.log;  
  root /var/www/html/thomas-walker-lynch.com;
  index index.php;
  location ~ \.php$ {
      include snippets/fastcgi-php.conf;
      fastcgi_pass unix:/run/php/php7.3-fpm.sock;
   }
    ssl_certificate
/etc/letsencrypt/live/reasoningtechnology.com-0001/fullchain.pem; # managed
by Certbot
    ssl_certificate_key
/etc/letsencrypt/live/reasoningtechnology.com-0001/privkey.pem; # managed by
Certbot

}

server {
  server_name _;
  return 404;
}


upstream wsgi_server_location{
 server unix://home/nginx_customer_gateway_mediary/socket;
}
server {
  server_name reasoningtechnology.com;
  charset utf-8;
  listen [::]:443 ssl;
  listen 443 ssl;
  access_log /var/log/nginx/cg.reasoningtechnology.com_access.log;
  error_log /var/log/nginx/cg.reasoningtechnology.com_error.log;  
  client_max_body_size 75M; 
  location / {
    uwsgi_pass wsgi_server_location;
    include uwsgi_params;
  }
  location /static/{
    root /var/www/html/customer_gateway;
  }
    ssl_certificate
/etc/letsencrypt/live/reasoningtechnology.com-0001/fullchain.pem; # managed
by Certbot
    ssl_certificate_key
/etc/letsencrypt/live/reasoningtechnology.com-0001/privkey.pem; # managed by
Certbot


}

Posted at Nginx Forum: https://forum.nginx.org/read.php?2,293269,293288#msg-293288



More information about the nginx mailing list