Browsing articles tagged with "nginx - 90/102 - Admins Goodies"
Aug 10, 2011
tom

Serving Tomcat under a sub-URI

I have a lot of services attached to a single domain, so I was hoping to serve Tomcat under, say, http://server_name/tomcat, with Nginx as a reverse proxy to Tomcat’s HTTP connector. The Nginx configuration is as simple as it gets: location /tomcat { include proxy_pass.conf; proxy_pass http://127.0.0.1:8080; } If I leave it as it is, Tomcat is unable to resolve requests that begin with /tomcat, but if I otherwise set alias /; in Nginx, then […]

Continue Reading »
Aug 10, 2011
tom

Nginx redirect loop

I am trying to transfer a site from one server to another. I normally use apache, but this project was using nginx and Ultimate SEO for url modification. I am using the same nginx config file but I am ending up with a redirect loop error. Here are the contents of the default file in sites-available: # You may add here your # server { # … # } # statements for each of your […]

Continue Reading »
Aug 10, 2011
tom

HTTP streaming server behind nginx?

I’m trying to set up a HTTP streaming server I wrote with Tornado and python. Basically, it keeps the connection alive and occasionally flushes information out. It’s a bit like long polling, except the connection isn’t broken by the server. Is it possible to put something like this behind nginx? I’m testing it from my browser, and I can’t see any output until the server breaks the connection, then it’s all sent at once. You […]

Continue Reading »
Aug 10, 2011
tom

How to set up a private CDN using nginx?

Here is the problem: I have a Linux server in Europe serving a busy Drupal site using nginx+php-fpm, I have another Linux server in the US (where a big portion of my visitors are coming from). The second server is heavily under-used. I am wondering how to make use of the second server to deliver my site’s static content? Install Nginx on the 2nd server and set it up as a lightweight static proxy cache […]

Continue Reading »
Aug 10, 2011
tom

PHP-FPM runs PHP scripts as root

I have a web server setup using nginx and PHP-FPM listening on a Unix socket. In my php-fpm.conf, I have specified user = www group = www When I run ps aux, I can see that the php-fpm worker processes run as www; the php-fpm master process runs as root. However, I noticed that PHP scripts are executed as root; at least that’s the output of echo get_current_user(); What can I do to run scripts […]

Continue Reading »
Aug 10, 2011
tom

Buffer limit for nginx?

I’m using nginx on an embedded platform (OpenWRT) as a reverse proxy in front of an IP camera, and I’m having an issue where the camera is pushing data to nginx more quickly than nginx is able to off-load it to the next stage. With the reverse proxy removed, extra frames just get dropped and that’s that. But nginx seems to buffer a substantial amount of the camera data (as much as 10-15 seconds worth […]

Continue Reading »
Aug 10, 2011
tom

Server slow response: ps aux shows many php5-fpm processes

I have just finished setting up my own VPS with the following specs: 2 Ghz single core CPU and 1 GB RAM. I’m using nginx for my webserver needs. I installed Ruby on Rails, Phusion Passenger, mysql and php5-fpm. I uploaded a WordPress blog and am experiencing slow responsiveness: http://cl.ly/6Hks. CPU load is about 10-20% when requesting a page. When I look at ps aux I see the following output: root 896 0.0 0.3 40916 […]

Continue Reading »
Aug 10, 2011
tom

NGINX Redirect Rule: Subfolder only to HTTPS?

I’m trying to redirect anyone who access the admin section of my site to the HTTPS version of it. The current rewrite rule is as follows: server { listen 80; server_name domain.com; location / { index index.php index.html; root /home/domain.com/public; } #Redirect Admin requests to secure server location /www/admin/ { rewrite ^/(.*) https://domain.com$1 permanent; } } The problem with this rule is it is only forwarding http://domain.com/www/admin to HTTPS – going to http://domain.com/www/admin/index.php , for […]

Continue Reading »
Aug 10, 2011
tom

php5-fpm + nginx + drupal7 : keeps sending me index.php for download

Pulling my hairs out here can’t figure out why : My virtual host in /etc/nginx/sites-available/ server { listen 80 default; location / { root /var/www; index index.php; } location ~* .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; fastcgi_param PATH_INFO $fastcgi_script_name; include fastcgi_params; } } nginx.conf user www; worker_processes 4; pid /var/run/nginx.pid;events { worker_connections 768; multi_accept on; }http { sendfile on; tcp_nopush on; tcp_nodelay on; keepalive_timeout 65; types_hash_max_size 2048; server_tokens off; include /etc/nginx/mime.types; default_type […]

Continue Reading »
Aug 10, 2011
tom

NGINX and local-hosted custom domain names

I’m setting up a nginx webserver locally with this config: server { server_name im; access_log /var/www/im/website.access_log; error_log /var/www/im/website.error_log;root /var/www/im; index index.php index.htm index.html;location ~ .php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/im/$fastcgi_script_name; include fastcgi_params; } } I want to access the local-hosted site with “im/”, instead, i get a “not found”. The only thing that works is “localhost”. Is this possible? What should i correct/add to my config? The name needs to resolve from […]

Continue Reading »
Pages:«1...87888990919293...102»