Category Archives: Nginx

deny access to URL- nginx regex

Questions: What regex would I use to deny every URL using “?”: Ex. and location (need regex){ deny all; } Answers: I believe \? would do what you want, ^\? is the reverse expression.

Help with starting up my thin server with Sinatra

Questions: I’m a newcomer trying to get my feet wet with Ruby and Sinatra. I followed the Slicehost articles in getting Ruby 1.9.1 setup along with Thin 1.2.7 with a reverse proxy to Nginx. Most things were going pretty smooth until I tried to start up my thin server. This is the output I get… Read More »

Why does nginx + memcache corrupt my response body?

Questions: I’m caching some web pages in memcache. When I read the page directly from the cache, the page is well formed like this … !DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN”-:– 0 “”> <html xmlns=”” xml:lang=”en” lang=”en”> <head> <meta http-equiv=”content-type” content=”text/html;charset=UTF-8″ /> but when I use a browser or curl to read it from… Read More »

With nginx/php-fpm, location header sometimes ignored by browser. Why?

Questions: I’m in the process of moving a working apache/mod-php website to nginx/php-fpm. Under Apache/mod-php, I could use header(“Location: $url”); to redirect the browser to a different page, such as after a login attempt. After switching to nginx/php-fpm, the browser would no longer follow that redirect on certain pages. I confirmed with Firebug and Httpfox… Read More »

How do I serve statical Jira's files with nginx?

Questions: My actual nginx configuration is like this: server { listen 443; server_name; ssl_certificate /etc/ssl/certs/jira.crt; ssl_certificate_key /etc/ssl/private/jira.key; ssl on; location / { proxy_pass; proxy_set_header X-Forwarded-Proto https; proxy_set_header Host $http_host; } } How do I serve statical file with Jira standalone edition? Answers: nginx has to be used as a proxy server with Jira… Read More »

I have nginx running with spawncgi php, POST and GET data is not getting through

Questions: I cant get anything through the URL parameters or form submissions… $_GET and $_POST vars are always empty…. Tried same setup on apache … worked perfectly… whats up? any ideas guys? Answers: I had this issue, until I included my fastcgi_params correctly. include /usr/local/nginx/conf/fastcgi_params; file content fastcgi_param QUERY_STRING $query_string; fastcgi_param REQUEST_METHOD $request_method; fastcgi_param CONTENT_TYPE… Read More »