Questions tagged [nginx]

Nginx is a web and proxy server. Note that questions on the use and configuration of server software may be off-topic and subject to closure if they do not directly involve a programming context. Other Stack Exchange sites such as Super User, Server Fault, or Webmasters may be more appropriate places to ask such questions.

Nginx ("engine x") is a lightweight and high-performance HTTP , and , released under a BSD-like license.

From the nginx wiki:

Nginx is a free, open-source, high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server. Igor Sysoev started development of Nginx in 2002, with the first public release in 2004. Nginx now hosts nearly 12.18% (22.2M) of active sites across all domains. Nginx is known for its high performance, stability, rich feature set, simple configuration, and low resource consumption.

Resources:

Useful Links

Talks

Tengine

54687 questions
12
votes
1 answer

How to set content-type in proxy_pass?

On a website traffic is flowing in via http for location /instance we need the traffic to be secure using SSL and https. When redirecting to https, the request content-type is "text/xml" when it actually should be "application/json". Should we…
Bennett_bear
  • 121
  • 1
  • 1
  • 3
12
votes
4 answers

Python multiprocessing Pool hangs on ubuntu server

I'm running Django on an Ubuntu server with nginx and gunicorn. I'm trying to do some multiprocessing which is working on my local machine but hangs until the gunicorn worker times out on my server. cpu_count = int(multiprocessing.cpu_count()) pool…
apardes
  • 4,272
  • 7
  • 40
  • 66
12
votes
2 answers

Why is proxy_set_header Host $host; no longer working in nginx 1.8.0?

I used proxy_set_header Host $host; to set the host header to the original request host. In nginx 1.4.1 this was working fine. Now after upgrading to 1.8.0, I'm getting the local IP instead of the host passed by the browser. Why did this happen and…
iwein
  • 25,788
  • 10
  • 70
  • 111
12
votes
1 answer

Only allow certain countries traffic access specific page

I am using --with-http_geoip_module for identify traffic. There are some pages that I only want certain country to access. Here is configuration: For http http{ geoip_country /usr/share/GeoIP/GeoIP.dat; # the country IP database map…
dev-jim
  • 2,404
  • 6
  • 35
  • 61
12
votes
3 answers

Laravel route() returning naked IP address instead of domain

Didn't catch this on my local machine but I've noticed some of my pages returning the naked IP address of my web server instead of the domain name. Example: route('homepage') will sometimes return 192.XX8.X.2XX or 192.XX8.X.2XX/index.php or…
Helen Che
  • 1,951
  • 5
  • 29
  • 41
12
votes
1 answer

Upstart: Job failed to start

EDIT status marybaked yields marybaked stop/waiting Here is the output of /var/log/syslog : May 3 16:24:39 marybakedpdx kernel: [ 3464.189563] init: Failed to spawn marybakedpdx main process: unable to find setuid user May 3 16:24:44…
redress
  • 1,399
  • 4
  • 20
  • 34
12
votes
1 answer

ngnix to proxy server B only if got 404 on server A

I'm trying to configure nginx (0.7.65) so it'll proxy to server A, and if it gets 404 will try to proxy to server B. I've tried the following, but it doesn't work. Any ideas? server { error_log /tmp/nginx.error.log; access_log …
Miki Tebeka
  • 13,428
  • 4
  • 37
  • 49
12
votes
4 answers

Server-side auto-minify?

Is there any way to automatically minify static content and then serve it from a cache automatically? Similar to have mod_compress/mod_deflate work? Preferably something I could use in combination with compression (since compression has a more…
Brendan Long
  • 53,280
  • 21
  • 146
  • 188
12
votes
1 answer

Gorilla WebSocket disconnects after a minute

I'm using Go (Golang) 1.4.2 with Gorilla WebSockets behind an nginx 1.4.6 reverse proxy. My WebSockets are disconnecting after about a minute of having the page open. Same behavior occurs on Chrome and Firefox. At first, I had problems connecting…
425nesp
  • 6,936
  • 9
  • 50
  • 61
12
votes
1 answer

Using prerender with proxy in nginx

I'm trying to use prerender.io to get an snapshot of angularjs pages. Currently I have an NodeJS instance for the web app and nginx reverse proxy redirects requests from port 80 to 4000. According to prerender nginx manual…
Afshin Mehrabani
  • 33,262
  • 29
  • 136
  • 201
12
votes
2 answers

How do I install php mbstring extension in to Nginx Ubuntu

I need this php extension in order to use one of my Magento extension. How do I install php mbstring extension to my Nginx Ubuntu 14.04?
n01
  • 135
  • 1
  • 1
  • 7
12
votes
4 answers

how to deploy yeoman angular-fullstack project?

I want to deploy a simple angular projet made with angular fullstack. https://github.com/DaftMonk/generator-angular-fullstack I tried : yo angular-fullstack test grunt build Then, in dist I got 2 folders: server and public. how to deploy them on a…
toffd
  • 217
  • 1
  • 3
  • 8
12
votes
2 answers

nginx configuration for a RESTful API

I am a beginner with nginx and php, so please excuse my basic question. For a RESTful based API (nginx + php) I would need some help with nginx configuration. Here is the relevant snippet of the nginx configuration (as suggested here) for…
knowledge_quest
  • 135
  • 1
  • 1
  • 6
12
votes
2 answers

AWS Elastic Beanstalk - Request Entity Too Large (413)

I am trying to deploy a Node-based web service to elastic beanstalk but running into problems when posting too much data. The issue seems to be at the nginx layer, not the Node / express layer. The message I get is: 413 Request…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/node.js" class="post-tag grid--cell" title="show questions tagged 'node.js'" rel="tag">node.js</a> <a href="../../questions/tagged/amazon-web-services" class="post-tag grid--cell" title="show questions tagged 'amazon-web-services'" rel="tag">amazon-web-services</a> <a href="../../questions/tagged/nginx" class="post-tag grid--cell" title="show questions tagged 'nginx'" rel="tag">nginx</a> <a href="../../questions/tagged/amazon-elastic-beanstalk" class="post-tag grid--cell" title="show questions tagged 'amazon-elastic-beanstalk'" rel="tag">amazon-elastic-beanstalk</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 22 '14 at 21:53">asked Dec 22 '14 at 21:53</time> <a href="../../users/381458/whitehawk" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/381458.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="whitehawk" /> </a> <div class="s-user-card--info"> <a href="../../users/381458/whitehawk" class="s-user-card--link">whitehawk</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">2,429</li> <li class="s-award-bling s-award-bling__silver" title="29 silver badges">29</li> <li class="s-award-bling s-award-bling__bronze" title="33 bronze badges">33</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="mln24"> <div class="question-summary" id="question-summary-27420874"> <div class="statscontainer"> <div class="stats"> <div class="vote"> <div class="votes"> <span class="vote-count-post"><strong>12</strong></span> <div class="viewcount">votes</div> </div> </div> <div class="status answered-accepted"> <strong>1</strong> answer </div> </div> </div> <div class="summary"> <h3><a href="../../questions/27420874/nginx-and-uwsgi-gives-504-gateway-timeout" class="question-hyperlink">nginx and uWSGI gives "504 Gateway timeout"</a></h3> <div class="excerpt">I am following the tutorial Setting up Django and your web server with uWSGI and nginx. uWSGI is up and running I set up uwsgi to serve my Django project with the following line. mydjangoproj $ uwsgi --http 0.0.0.0:8002 --module wsgi --harakiri…</div> <div class="grid ai-start jc-space-between fw-wrap"> <div class="grid gs4 fw-wrap tags "> <a href="../../questions/tagged/django" class="post-tag grid--cell" title="show questions tagged 'django'" rel="tag">django</a> <a href="../../questions/tagged/nginx" class="post-tag grid--cell" title="show questions tagged 'nginx'" rel="tag">nginx</a> <a href="../../questions/tagged/uwsgi" class="post-tag grid--cell" title="show questions tagged 'uwsgi'" rel="tag">uwsgi</a> </div> <div class="started mt0"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Dec 11 '14 at 10:42">asked Dec 11 '14 at 10:42</time> <a href="../../users/735070/mads-skjern" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/735070.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Mads Skjern" /> </a> <div class="s-user-card--info"> <a href="../../users/735070/mads-skjern" class="s-user-card--link">Mads Skjern</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">5,648</li> <li class="s-award-bling s-award-bling__gold" title="6 gold badges">6</li> <li class="s-award-bling s-award-bling__silver" title="36 silver badges">36</li> <li class="s-award-bling s-award-bling__bronze" title="40 bronze badges">40</li> </ul> </div> </div> </div> </div> </div> </div> </div> <div class="s-pagination pager fr"> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=93" rel="prev" title="Go to page 93">Prev </a> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=1" rel="" title="Go to page 1">1</a> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=2" rel="" title="Go to page 2">2</a> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=3" rel="" title="Go to page 3">3</a> <div class="s-pagination--item s-pagination--item__clear">…</div> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=99" rel="" title="Go to page 99">99</a> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=100" rel="" title="Go to page 100">100</a> <a class="s-pagination--item" href="../../questions/tagged/nginx_page=95" rel="next" title="Go to page 95"> Next</a> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>