Welcome! Log In Create A New Profile

Advanced

Re: Domains not working as expected with nginx

July 08, 2022 03:56PM
server_tokens off;

# server_names_hash_bucket_size 64;

# server_name_in_redirect off;

ssl_prefer_server_ciphers on;

# server {

# listen localhost:110;

# server {

# listen localhost:143;

server {

listen 127.0.0.2:80;

server_name 127.0.0.2;

server unix:/tmp/php-cgi.socket;

server 127.0.0.1:9000;

server {

server_name secondarydomain.com;

fastcgi_param SERVER_PROTOCOL $server_protocol;

fastcgi_param SERVER_ADDR $server_addr;

fastcgi_param SERVER_PORT $server_port;

fastcgi_param SERVER_NAME $server_name;

server {

listen 443 ssl http2;

listen [::]:443 ssl http2;

ssl_prefer_server_ciphers off;

server_name sub.maindomain.com;

server {

listen 80 default_server;

listen [::]:80 default_server;

server {

listen 443 ssl http2;

listen [::]:443 ssl http2;

ssl_prefer_server_ciphers off;

server_name primarydomain.com www.primarydomain.com;

fastcgi_pass 127.0.0.1:9000; # or whatever port your PHP-FPM listens on

# fastcgi_pass 127.0.0.1:9000; # or whatever port your
PHP-FPM listens on


Jason Crews

On Fri, Jul 8, 2022 at 11:07 AM Francis Daly <francis@daoine.org> wrote:
>
> On Fri, Jul 08, 2022 at 10:14:13AM -0700, Jason Crews wrote:
>
> Hi there,
>
> > I'm not sure what I've got misconfigured here, I would appreciate
> > anyone who could point me in the right direction.
> > Site structure:
> >
> > maindomain.com -> mediawiki -> works
> > sub.maindomain.com -> basic php website -> works
> > secondarydomain.com -> wordpress -> goes to sub.maindomain.com
> >
> > I've posted all of the config files on reddit:
> > https://www.reddit.com/r/nginx/comments/vtuha9/domains_not_going_where_expected/
>
> For each server{} block that you have, what are the "listen" directives
> and what are the "server_name" directives.
>
> $ nginx -T | grep 'server\|listen'
>
> will probably give a reasonable starting point for that data. Feel
> free to edit it to hide anything you consider private; but please be
> consistent. If you use the same IP address in the config twice, edit it
> to the same thing. If you use different IP addresses, edit them to be
> different things -- anything in the 10.x network is "private enough".
>
> And for server_name entries, one.example.com, two.examle.com, and
> *.example.net might be reasonable ways to edit thing.
>
> (Also: feel free not to change things if you don't consider them private.)
>
> And when you report something not working, please be specific about http
> or https, to which particular hostname.
>
> (And confirm whether the hostname resolves to the IP address that nginx
> is listening on.)
>
> Hopefully the answers to those will make it clear what is happening,
> and what should be changed to make things happen the way you want them
> to happen.
>
> Cheers,
>
> f
> --
> Francis Daly francis@daoine.org
> _______________________________________________
> nginx mailing list -- nginx@nginx.org
> To unsubscribe send an email to nginx-leave@nginx.org
_______________________________________________
nginx mailing list -- nginx@nginx.org
To unsubscribe send an email to nginx-leave@nginx.org
Subject Author Posted

Domains not working as expected with nginx

the1gofer July 08, 2022 01:16PM

Re: Domains not working as expected with nginx

Francis Daly July 08, 2022 02:08PM

Re: Domains not working as expected with nginx

the1gofer July 08, 2022 03:56PM

Re: Domains not working as expected with nginx

Francis Daly July 08, 2022 07:52PM

Re: Domains not working as expected with nginx

Ian Hobson July 09, 2022 06:24AM

Re: Domains not working as expected with nginx

the1gofer July 11, 2022 10:36PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 62
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready