Skip to content

Instantly share code, notes, and snippets.

@slok
Created June 23, 2011 06:54
Show Gist options
  • Save slok/1042053 to your computer and use it in GitHub Desktop.
Save slok/1042053 to your computer and use it in GitHub Desktop.
Nginx config file
#/etc/nginx/nginx.conf
user nobody nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
#log_format main '$remote_addr - $remote_user [$time_local] "$request" '
# '$status $body_bytes_sent "$http_referer" '
# '"$http_user_agent" "$http_x_forwarded_for"';
#access_log logs/access.log main;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
# Config para Django +uWSGI
#upstream djprueba {
#server unix:/tmp/uwsgi-djprueba.sock;
#}
server {
listen 80;
server_name localhost slok.homelinux.com;
root /var/www/nginx ;
#autoindex on;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
autoindex off;
index index.html index.htm;
}
location /pelis+series {
autoindex on;
}
location /cosas {
autoindex on;
}
location /pma {
index index.php;
}
location /piwik {
index index.php;
}
#DJANGO PROJECTS
location /djprueba {
#Config for Django and uWSGI project
#uwsgi_pass djprueba; #the upstream block name for the load-balancing(we can do it without upstream)
uwsgi_pass unix:/tmp/uwsgi-djprueba.sock;
include uwsgi_params;
}
#FOR PHP
location ~ \.php$ {
#set $php_root $document_root;
#if we come from the pma then set other root directory
#if ($request_uri ~* /pma) {
#set $php_root $document_root/pma;
#}
#fastcgi_param SCRIPT_FILENAME $php_root$fastcgi_script_name;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_pass 127.0.0.1:9000;
}
#error_page 404 /404.html;
# redirect server error pages to the static page /50x.html
#
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server{
listen 80;
server_name slok.game-host.org;
root /var/www/nginx/osqa ;
#autoindex on;
#charset koi8-r;
#access_log logs/host.access.log main;
################## OSQA #################################
location /m/ {
alias /var/www/nginx/osqa/forum/skins/;
}
location /upfiles/ {
alias /var/www/nginx/osqa/forum/upfiles/;
}
location /admin_media/ {
alias /var/www/nginx/osqa/admin_media/;
}
location / {
#Config for Django and uWSGI project
uwsgi_pass unix:/tmp/uwsgi-osqa.sock;
include uwsgi_params;
}
##########################################################
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment