T
T
Twelfth Doctor2017-01-23 18:37:53
Nginx
Twelfth Doctor, 2017-01-23 18:37:53

Where is the error in the nginx config file?

Hello! Please tell me where is the error in the configuration file of the nginx virtual host?

server {
listen 80;
server_name *** ***;
user *** ***
location / {
proxy_pass http://127.0.0.1:8080;
}

location ~* \.(html|jpeg|jpg|gif|png|css|js|pdf|txt|tar|ico)$ {
root /home/***;
expires 60d;
}
}

When restarting, an error occurs:
[emerg] "user" directive is not allowed here
Where should the user directive be placed in order for everything to work?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
S
Slava Kryvel, 2017-01-23
@kryvel

nginx.org/en/docs/ngx_core_module.html#user
The context for user is only main. Those. user and group can only be set globally
Well and ; you are missing after user

Евгений Вольф, 2017-01-23
@Wolfnsex

/etc/nginx/nginx.conf, подробности
UPD. Обновил картинку.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question