There is an error on two pages. How can i fix 502 Bad Gateway? Thanks for help. Have a nice day… http://luxger.com/galeri/motif - 502 error, 178 images http://luxger.com/galeri/gokyuzu - 502 error, 131 images http://luxger.com/galeri/gokyuzu-agac-cicek - no Error, 286 images Nginx Error log:
...upstream prematurely closed connection while reading response header from upstream, client: 84.104.247.91, server: www.luxgergitavan.com, request: "GET /galeri/motif HTTP/1.1",...
File: /etc/nginx/nginx.conf
worker_processes 4;
pid /run/nginx.pid;
events {
worker_connections 768;
}
http {
##
# Basic Settings
##
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
##
# Logging Settings
##
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log warn;
##
# Gzip Settings
##
gzip on;
gzip_disable "msie6";
##
# Virtual Host Configs
##
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-available/*;
}
File: /etc/nginx/sites-available/luxger.com
upstream luxger_app_server {
server unix:/var/www/luxger.com/run/gunicorn.sock fail_timeout=0;
}
server {
listen 80;
#listen [::]:80 default_server ipv6only=on;
client_max_body_size 4G;
sendfile on;
keepalive_timeout 0;
large_client_header_buffers 8 32k;
root /var/www/luxger.com/;
server_name www.luxgergitavan.com luxgergitavan.com luxger.com www.luxger.com;
access_log /var/www/luxger.com/logs/nginx-access.log;
error_log /var/www/luxger.com/logs/nginx-error.log;
keepalive_timeout 0;
large_client_header_buffers 8 32k;
location /static/ {
alias /var/www/luxger.com/static/;
}
location /media/ {
alias /var/www/luxger.com/media/;
}
location /static/admin {
alias /var/www/luxger.com/static/admin/;
}
location / {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_redirect off;
proxy_buffers 8 32k;
proxy_buffer_size 64k;
if (!-f $request_filename) {
proxy_pass http://luxger_app_server;
break;
}
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
#error_page 500 502 503 504 /50x.html;
#location = /50x.html {
# root /usr/share/nginx/html;
#}
}
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Sorry to see that your question hasn’t received an answer yet. Unfortunately, after this much time, it is unlikely that an answer for this specific question will be provided. For people still landing here via search, you will want to check the upstream service’s (Gunicorn, php-fpm, NodeJS, etc.) logs and see why it is returning an error.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.