You searched for articles tagged with nginx.

Macrocule??? Permalink

nginx, WDTEM Added less than a year ago and last edited less than a year ago

Through a series of events related to Google Analytics I have discovered a funny thing. It turns out that the domain name macrocule.net points to my server...

I've never heard of this domain before, let alone purchased it - I'm certainly not in control of it yet it resolves to my IP. Earlier today if you visited this domain you would have seen this blog.

After consultation with friends I've decided that the most probable cause is that someone has made a typo in their DNS records.

So I 'solved' the problem by altering my nginx conf to send requests for the domain in question to this lovely little page: http://macrocule.net

I hope the person gets the message.




nginx -> Django fcgi SSL! Permalink

nginx, Django Added less than a year ago and last edited less than a year ago

I have setup nginx as my webserver. It acts as a proxy in front of the django site running it's own fcgi server:

# from within your django project, run the fcgi server as such (must have flup installed)
/usr/bin/env python manage.py runfcgi host=127.0.0.1 port=8080 --settings=settings

I use SSL middleware in my django site to automatically redirect to https:// for certain URLs - mainly /admin/

My nginx.conf has to have two server configs, one for HTTP and one for HTTPS:

server {
    listen 80;
    server_name notareal.com.net.org;
    location /media {
        root /home/www/projectroot;
    }
    location / {
        fastcgi_pass 127.0.0.1:8080;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_pass_header Authorization;
        fastcgi_intercept_errors off;
    }
}
server {
    listen 443;
    ssl on;
    ssl_certificate /usr/local/nginx/ssl/server.crt;
    ssl_certificate_key /usr/local/nginx/ssl/server.key;
    keepalive_timeout 70;
    server_name notareal.com.net.org;
    location /media {
        root /home/www/projectroot;
    }
    location / {
        fastcgi_pass 127.0.0.1:8080;
        fastcgi_param SERVER_NAME $server_name;
        fastcgi_param SERVER_PORT $server_port;
        fastcgi_param SERVER_PROTOCOL $server_protocol;
        fastcgi_param PATH_INFO $fastcgi_script_name;
        fastcgi_param REQUEST_METHOD $request_method;
        fastcgi_param QUERY_STRING $query_string;
        fastcgi_param CONTENT_TYPE $content_type;
        fastcgi_param CONTENT_LENGTH $content_length;
        fastcgi_param HTTP_X_HTTPS on;
        fastcgi_pass_header Authorization;
        fastcgi_intercept_errors off;
    }
}

The magic line is fastcgi_param HTTP_X_HTTPS on; now we can modify our SSL redirection middleware to check for HTTP_X_HTTPS instead of HTTP_X_FORWARDED_SSL (or you could use HTTP_X_FORWARDED_SSL if you wanted, just change the nginx.conf)

And it all works well!




Build nginx from Source on NetBSD 5.0 Permalink

nginx, NetBSD Added less than a year ago and last edited less than a year ago

Here's my configure line:

# didn't include pcre because I don't need them yet, but might at some stage...
./configure --prefix=/usr/local/nginx --without-pcre --with-http_ssl_module --with-http_gzip_static_module --with-http_dav_module --without-http_rewrite_module --with-ld-opt="-static -static-libgcc"

Version: 0.7.61




(Nothing Older) ... (Nothing Newer)

Colophon

Django Python 960.gs Git Vim NetBSD Nginx

The Author

The author is a software engineer living in Australia. He sux at guitar, loves camping, doesn't like cake, does like coffee and is a lazy home brewer.

Meta

Help
Latest entries

*BSD Agile Apache Apple Athletics Beer Best-Practice Censorship Comedy Cool Crosswords Deployment Django English Exim Firefox Git Hardcore Health Interface irssi Javascript Jira Languages Linux Makefile Markdown Mathematics Mobile Broadband MySQL NetBSD nginx Nokia OSX Perl Photo Privacy Python Rant Requirements rsync Ruby Shell Slackware SQL SQLite SSH Standards Subversion Testing ThisBlog Vim VMWare (Fusion) VPN WDTEM X Yum zsh

Recent Entries

Perldoc Output
Yum
Possum
Git's Index
Jira Project Keys
The Coffee Shop
Git GUI
It is more important...
Questioning Unix (and Other) File Times
The Frog King Photo
Rain Cloud Photo
rsync
Timezone
utf8 in your Perl
Theatre Ceiling Photo
Some problems are so complex...
Colours in your PAGER
zsh vared
zsh magic-equals and double-star
Funny Tweets

Links

ChoppingBoard, Project365, RageQuit

♥ Actors/Artists/Characters