Domains not working as expected with nginx

Francis Daly francis at daoine.org
Fri Jul 8 18:06:56 UTC 2022


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 at daoine.org



More information about the nginx mailing list