Permalink
Browse files

update nginx config and add installer script

  • Loading branch information...
1 parent 26fbf48 commit 72c6417439805ee5c9c98b1d0609cab5a3f8ad4c @starius committed Sep 24, 2016
Showing with 62 additions and 4 deletions.
  1. +42 −4 example.nginx
  2. +20 −0 install.sh
View
@@ -1,5 +1,6 @@
-error_log stderr notice;
-daemon off;
+user www-data;
+worker_processes 4;
+pid /run/nginx.pid;
events {
worker_connections 100000;
@@ -9,14 +10,51 @@ worker_rlimit_nofile 200000; # 2 * worker_connections
http {
+ sendfile on;
+ tcp_nopush on;
+ tcp_nodelay on;
+ keepalive_timeout 65;
+ types_hash_max_size 2048;
+
+ error_log /dev/null;
+ access_log /dev/null;
+
+ include /etc/nginx/mime.types;
+ default_type application/octet-stream;
+
+ server {
+ listen 80 so_keepalive=10s:10s:8;
+ server_name onion.gq www.onion.gq;
+ location / {
+ default_type text/html;
+ root /var/www/onion2web/;
+ }
+ }
+
+ # For monitoring
+ # www.pastagdsp33j7aoq.onion.gq without confirmation
+ server {
+ listen 80;
+ server_name www.pastagdsp33j7aoq.onion.gq;
+ lua_check_client_abort on;
+ location / {
+ default_type text/html;
+ content_by_lua '
+ require("onion2web").handle_onion2web(
+ ".onion.gq", nil, nil, false
+ );
+ ';
+ }
+ }
+
server {
- listen 16662 so_keepalive=10s:10s:8;
+ listen 80;
server_name *.onion.gq;
lua_check_client_abort on;
location / {
default_type text/html;
content_by_lua '
- require("onion2web").handle_onion2web(".onion.gq:16662");
+ require("onion2web").handle_onion2web(".onion.gq");
';
}
}
View
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -xue
+
+apt-get --yes install nginx-extras
+apt-get --yes install luarocks
+luarocks install onion2web
+
+cp example.nginx /etc/nginx/nginx.conf
+
+wget -r -k -p -np -e robots=off -E https://starius.github.io/onion2web/
+mkdir -p /var/www
+rm -rf /var/www/onion2web
+cp -r starius.github.io/onion2web /var/www/onion2web
+
+wget https://raw.githubusercontent.com/starius/config/master/.bin/install-tor2web
+chmod +x install-tor2web
+./install-tor2web
+
+service nginx restart

0 comments on commit 72c6417

Please sign in to comment.