R
R
requnael2015-08-22 01:34:48
Nginx
requnael, 2015-08-22 01:34:48

Problem with nginx, does it switch to the domain base or does php not work?

The problem is this:
When I use sites-..... then when using invalid hostname
config: pastebin.com/FQCp7Jih
localhost does not work. I decided to put invalid hostname, because 3 domains are used on one machine, and if it is in the config in the first lists of example1.com and you write, say asdsad.example2.com, then it transfers to example1.com.
That is, there are two problems at once: localhost does not work and transfers to one domain if you write a non-existent subdomain.
nginx config: pastebin.com/2NFDKNcA
If I completely delete sites-.... and switch to *.conf, then php stops working. Ie stupidly white screen, no errors and nothing.
I tried all the methods and climbed Google, and did not find a solution to the problems.
I would like to use it without sites-... Because these redirects infuriate me, but through .conf it just shows that such a subdomain does not exist, etc. which is very convenient or can this be done through sites-.. too? , but for some reason php stopped working. Maybe something is wrong in the php config? Config here: pastebin.com/9MUqFTNB

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
Nikon_NLG, 2015-08-28
@Nikon_NLG

1. Use
listen 80 default;
for default domain
2. If you need asdasd.example2.com - make
server_name *.example2.com;
3. look at the output of
nginx -t
, it will show you exactly where the error is
4. If you have a test development, add to www.conf (or what is your config for php-fpm):
php_flag[display_errors] = on
php_admin_value[error_log] = / var/log/$pool.www.log
php_admin_flag[log_errors] = on
Or check /var/log/nginx/error.log to see if requests reach php-fpm

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question