nginx

PHP _SERVER["USER"] and _SERVER["HOME"]

I run PHP via FastCGI with nginx web server on Gentoo. PHP is started by spawn-fcgi script from lighttpd, which is started run as a daemon using start-stop-daemon. Among other things, startup scripts cleans-up environment, so that only PATH, PHP_FCGI_CHILDREN and PHP_FCGI_MAX_REQUESTS are left when PHP is started. However on my machine, ...

Mod Rewrite for NGINX

Hi Everyone, I'm currently using nginx as a transparent proxy for apache. I would like to use nginx + fcgi(php) but need mod-rewrite support. Is this possible or is there an alternative solution to my woes? This is for only 1 site, would litespeed be an effective solution? ...

NGINX Secure Subdomain

I am looking to set up a secure subdomain on my server. Here is my NGINX configuration... This works but I'm looking for htp[s]://transmission.example.com to proxy pass locally to 127.0.0.1:9091 and htp://example.com to proxy_pass to the app_server. This works, I can can go to htps://example.com and htp://example.com but I would like t...

Is it possible to use modify nginx config file and use X-Accel-Redirect on Heroku?

Reading this article on nginx website, I'm interested in using X-Accel-Redirect header in the way that Apache or Lighttpd users might use the X-Sendfile header to help with the serving of large files. Most tutorials I've found require you to modify the nginx config file. Can I modify the nginx config file on Heroku and if so, how? ...

nginx - How to extract the domain name out of the full uri ?

Hi folks, i have a nginx server running on ipv6 native. I want to set up a "proxy" to ipv4 with it. server { listen [::]:80; location / { proxy_pass http://www.mydomain.com proxy_set_header X-Real-IP $remote_addr; } } The Idea is to set up a AAAA record "ipv6.mydomain.com", and nginx should chan...

NGINX - redirect from https to http without ssl certificate

Hello, I'm setting up a new nginx box however I can't figure out why my nginx isn't starting when I use this: server { listen 443; server_name mysite.com; // https://mysite.com rewrite ^(.*) https://mynewsite.com.com$1 permanent; // new site } Anyone help me out? ...

Partly loaded javascript file

Hi, we have a FreeBSD OS system, an nginx webserver and php-fpm as PHP CGI. Sometimes .js and .css files are loaded only partly, about 5-7 words in the end of the file are missing, so we have a problem with visual part of our site as it becomes ugly cause of partly loaded javascript or css file. We tried to disable gzip, but it did not h...

host both test and development for the same app in Phusion Passenger

Hi, I use passenger with nginx. I have multiple apps and they talk to each other. I configure the passenger to host these same apps in both test and dev environments. Now the problem is sometimes when I go to the dev environment on app1, and the app1 talks to the app2, but it hit the app2's test url. If I use mongrel no such proble...

Nginx proxy module and socket descriptor passing

I'm implementing a server passing socket descriptors to worker processes for handling. It send them via UNIX sockets using the sendmsg system call. Server itself can listen on a UNIX socket or an INET socket. I have a problem putting it behind nginx. When my server runs on a INET socket, everything is OK. But proxing doesn't work through...

Rails route to model instance - by domain name

I have a Rails 3 application, say, with hotels, where hotels belong to parent areas. When a user hits the app (served by mongrel >> nginx), I want the domain name used in the request to decide what area of hotels to serve up (domain name >> area). To achieve this I can see two options: 1) Rewrite the URL with nginx, inserting the are...

Should Nginx Be Combined With Language Supporting Asynchronous Programming Model?

I found there are a lot of articles comparing Nginx and Apache in Internet. However, all these comparisons are based on stress test to web server running PHP code. I suppose this is mainly due to Apache is generally deployed with PHP as LAMP architecture. In my understanding, Nginx is created to solve C10K problem with event-based arc...

cache-control no-cache mechanism (lowest common denominator behaviour in a sea of badly implemeneted legacy proxies)

I'm working on a Kerberos style cookie-based authentication mechanism for static files for the Nginx web-server (the cookie contains an encrypted string which much match with a sub-string in the URL, the sub-string is specified by a regular expression). The system does not require MITM security, and if it will we will probably just enabl...

Is there a way to avoid nginx 411 Content-Length required errors?

I'm getting a 411 status back from nginx when trying to do a PUT without specifying the content-length. Is there any way to disable this from happening? ...

Session/authorize comet on Nginx HTTP PUSH

The Nginx approach to HTTP PUSH is relatively simple. There are 3 party involve: Subcriber (receiver), Publisher (sender), and the server itself act as multicast server. Nginx can also separate into different channel with different channel ID that user can access. But I still don't know how to authorize/limit content only for logged in...

uri_for includes port number on redirects

I'm attempting to implement a Catalyst application using nginx as a frontend web proxy for static files, and using Starman for my backend webserver. (I could use Apache & FastCGI and it works just fine, but I'd really like to get the whole PSGI / Plack and Starman thing ironed out) Starman starts up okay and can handle my requests ju...

Django: ugly admin interface

Hi everyone, I'm using Django on a Debian VM, django server is loaded through nginx. Everything's working fine 'til now, except the admin interface. In fact, the admin site, doesn't load the "look and feel" of the interface. It seems that Css and images aren't loading at all, any ideas? Thanks. ...

converting htaccess to nginx, some help wanted

Anyone can help me fix below code? I did an auto convertion but many essentials were not converted RewriteEngine On RewriteCond %{REQUEST_METHOD} ^GET RewriteCond %{DOCUMENT_ROOT}/website/var/assets%{REQUEST_URI} -f RewriteRule ^(.*)$ /website/var/assets%{REQUEST_URI} [PT,L] RewriteRule ^website/var/tmp.* - [PT,L] RewriteRule ^website...

nginx proxy from 80 to 444 same IP

Hi, I have some webs that are served by nginx with SSL (443) without problems. Now, I have the web mail serving SSL on port 444, but I want nginx to proxy from 80 to 444 when webmail.mydomain.com reaches. I've tried some config but no one of them worked. This is the last one ... thanks, m. server { listen 80; server_name ...

edit urls.py require webserver restart?

Really basic question. Learning Django and now working on development server with nginx set up for me. I've edited my urls.py file in my django project but its not registering the change. Do i need to restart nginx every time I edit the urls.py file? I don't have root access so this wouldn't be possible or is there a local level way of...

Http POST drops port in URL

I have a webapp built with Django. I'm currently running it off a laptop at home behind a router. I have the router configured to route all traffic sent to a specific port to that laptop. I have Nginx as a reverse proxy for Apache, using mod_wsgi to run Django. My problem is this: when I try to submit any POST form, the port # gets r...