Nginx: Failed to start A high performance web server and a reverse proxy server
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgO9GURib1T8z7lCwjOGLQaGtrueEthgQ8LO42ZX8cOfTqDK4jvDDpKkLFwf2J49kYCMNW7d4ABih_XCb_2UXdq5fPJDkoyg7-8g_YfRUot-XnaXkNYycsNp7lA5_TW9td0FFpLQ2APzKcZ/s1600/1.jpg)
![Creative The name of the picture](https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhYQ0N5W1qAOxLP7t7iOM6O6AzbZnkXUy16s7P_CWfOb5UbTQY_aDsc727chyphenhyphen5W4IppVNernMMQeaUFTB_rFzAd95_CDt-tnwN-nBx6JyUp2duGjPaL5-VgNO41AVsA_vu30EJcipdDG409/s400/Clash+Royale+CLAN+TAG%2523URR8PPP.png)
up vote
3
down vote
favorite
I recently tried to install letsencrypt certificate, but I couldn't start nginx again. when I run the command service nginx status. I get this error message
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Tue 2018-02-20 16:17:49 CET; 8min
ago
Process: 1439 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
master_process on; (code=exited, status=1/FAILURE)
Feb 20 16:17:47 django-s-1vcpu-1gb-lon1-01 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:87
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Unit entered failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Failed with result 'exit-code'.
And here is /etc/nginx/sites-avalible/django
upstream app_server
server unix:/home/django/gunicorn.socket fail_timeout=0;
server
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
server_name nettside.no;
ssl_certificate /etc/letsencrypt/live/nettside.no/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nettside.no/privkey.pem;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name nettside.no;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media
alias /home/django/django_project/django_project/media;
# your Django project's static files - amend as required
location /static
alias /home/django/django_project/static;
# Proxy the static assests for the Django Admin panel
location /static/admin
alias /home/django/django_project/static/admin;
location /
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
server
listen 80;
server_name nettside.no;
return 301 https://$host$request_uri;
Thanks for the help.
nginx
add a comment |Â
up vote
3
down vote
favorite
I recently tried to install letsencrypt certificate, but I couldn't start nginx again. when I run the command service nginx status. I get this error message
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Tue 2018-02-20 16:17:49 CET; 8min
ago
Process: 1439 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
master_process on; (code=exited, status=1/FAILURE)
Feb 20 16:17:47 django-s-1vcpu-1gb-lon1-01 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:87
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Unit entered failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Failed with result 'exit-code'.
And here is /etc/nginx/sites-avalible/django
upstream app_server
server unix:/home/django/gunicorn.socket fail_timeout=0;
server
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
server_name nettside.no;
ssl_certificate /etc/letsencrypt/live/nettside.no/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nettside.no/privkey.pem;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name nettside.no;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media
alias /home/django/django_project/django_project/media;
# your Django project's static files - amend as required
location /static
alias /home/django/django_project/static;
# Proxy the static assests for the Django Admin panel
location /static/admin
alias /home/django/django_project/static/admin;
location /
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
server
listen 80;
server_name nettside.no;
return 301 https://$host$request_uri;
Thanks for the help.
nginx
The error messages reads"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.
â Bob
Feb 22 at 16:35
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37
add a comment |Â
up vote
3
down vote
favorite
up vote
3
down vote
favorite
I recently tried to install letsencrypt certificate, but I couldn't start nginx again. when I run the command service nginx status. I get this error message
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Tue 2018-02-20 16:17:49 CET; 8min
ago
Process: 1439 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
master_process on; (code=exited, status=1/FAILURE)
Feb 20 16:17:47 django-s-1vcpu-1gb-lon1-01 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:87
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Unit entered failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Failed with result 'exit-code'.
And here is /etc/nginx/sites-avalible/django
upstream app_server
server unix:/home/django/gunicorn.socket fail_timeout=0;
server
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
server_name nettside.no;
ssl_certificate /etc/letsencrypt/live/nettside.no/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nettside.no/privkey.pem;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name nettside.no;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media
alias /home/django/django_project/django_project/media;
# your Django project's static files - amend as required
location /static
alias /home/django/django_project/static;
# Proxy the static assests for the Django Admin panel
location /static/admin
alias /home/django/django_project/static/admin;
location /
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
server
listen 80;
server_name nettside.no;
return 301 https://$host$request_uri;
Thanks for the help.
nginx
I recently tried to install letsencrypt certificate, but I couldn't start nginx again. when I run the command service nginx status. I get this error message
nginx.service - A high performance web server and a reverse proxy server
Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset:
enabled)
Active: failed (Result: exit-code) since Tue 2018-02-20 16:17:49 CET; 8min
ago
Process: 1439 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on;
master_process on; (code=exited, status=1/FAILURE)
Feb 20 16:17:47 django-s-1vcpu-1gb-lon1-01 systemd[1]: Starting A high performance web server and a reverse proxy server...
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:87
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 nginx[1439]: nginx: configuration file /etc/nginx/nginx.conf test failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Control process exited, code=exited status=1
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: Failed to start A high performance web server and a reverse proxy server.
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Unit entered failed
Feb 20 16:17:49 django-s-1vcpu-1gb-lon1-01 systemd[1]: nginx.service: Failed with result 'exit-code'.
And here is /etc/nginx/sites-avalible/django
upstream app_server
server unix:/home/django/gunicorn.socket fail_timeout=0;
server
#listen 80 default_server;
#listen [::]:80 default_server ipv6only=on;
listen 443 ssl;
server_name nettside.no;
ssl_certificate /etc/letsencrypt/live/nettside.no/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/nettside.no/privkey.pem;
root /usr/share/nginx/html;
index index.html index.htm;
client_max_body_size 4G;
server_name nettside.no;
keepalive_timeout 5;
# Your Django project's media files - amend as required
location /media
alias /home/django/django_project/django_project/media;
# your Django project's static files - amend as required
location /static
alias /home/django/django_project/static;
# Proxy the static assests for the Django Admin panel
location /static/admin
alias /home/django/django_project/static/admin;
location /
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $host;
proxy_redirect off;
proxy_buffering off;
proxy_pass http://app_server;
server
listen 80;
server_name nettside.no;
return 301 https://$host$request_uri;
Thanks for the help.
nginx
nginx
asked Feb 20 at 15:35
![](https://lh5.googleusercontent.com/-muY88oE3M0Q/AAAAAAAAAAI/AAAAAAAAAGQ/1ffj74Hw974/photo.jpg?sz=32)
![](https://lh5.googleusercontent.com/-muY88oE3M0Q/AAAAAAAAAAI/AAAAAAAAAGQ/1ffj74Hw974/photo.jpg?sz=32)
ranjith
1612
1612
The error messages reads"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.
â Bob
Feb 22 at 16:35
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37
add a comment |Â
The error messages reads"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.
â Bob
Feb 22 at 16:35
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37
The error messages reads
"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.â Bob
Feb 22 at 16:35
The error messages reads
"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.â Bob
Feb 22 at 16:35
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37
add a comment |Â
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1008078%2fnginx-failed-to-start-a-high-performance-web-server-and-a-reverse-proxy-server%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
var $window = $(window),
onScroll = function(e)
var $elem = $('.new-login-left'),
docViewTop = $window.scrollTop(),
docViewBottom = docViewTop + $window.height(),
elemTop = $elem.offset().top,
elemBottom = elemTop + $elem.height();
if ((docViewTop elemBottom))
StackExchange.using('gps', function() StackExchange.gps.track('embedded_signup_form.view', location: 'question_page' ); );
$window.unbind('scroll', onScroll);
;
$window.on('scroll', onScroll);
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
The error messages reads
"location" directive is not allowed here in /etc/nginx/nginx.conf:87
. There is a configuration error in the nginx.conf file on line 87. Please check yourself or paste nginx.conf here.â Bob
Feb 22 at 16:35
Thank you for answering. The problem was that i had a lovation i my nginx.conf file
â ranjith
Feb 22 at 16:37