-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added nginx support for hosteurope server. refactored
- Loading branch information
chris flöß
committed
Jul 22, 2010
1 parent
102c50c
commit 5ccf196
Showing
17 changed files
with
426 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
#! /bin/sh | ||
|
||
### BEGIN INIT INFO | ||
# Provides: nginx | ||
# Required-Start: $all | ||
# Required-Stop: $all | ||
# Default-Start: 2 3 4 5 | ||
# Default-Stop: 0 1 6 | ||
# Short-Description: starts the nginx web server | ||
# Description: starts nginx using start-stop-daemon | ||
### END INIT INFO | ||
|
||
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
DAEMON=/opt/nginx/sbin/nginx | ||
NAME=nginx | ||
DESC=nginx | ||
|
||
test -x $DAEMON || exit 0 | ||
|
||
# Include nginx defaults if available | ||
if [ -f /etc/default/nginx ] ; then | ||
. /etc/default/nginx | ||
fi | ||
|
||
set -e | ||
|
||
case "$1" in | ||
start) | ||
echo -n "Starting $DESC: " | ||
start-stop-daemon --start --quiet --pidfile /opt/nginx/logs/$NAME.pid \ | ||
--exec $DAEMON -- $DAEMON_OPTS || true | ||
echo "$NAME." | ||
;; | ||
stop) | ||
echo -n "Stopping $DESC: " | ||
start-stop-daemon --stop --quiet --pidfile /opt/nginx/logs/$NAME.pid \ | ||
--exec $DAEMON || true | ||
echo "$NAME." | ||
;; | ||
restart|force-reload) | ||
echo -n "Restarting $DESC: " | ||
start-stop-daemon --stop --quiet --pidfile \ | ||
/opt/nginx/logs/$NAME.pid --exec $DAEMON || true | ||
sleep 1 | ||
start-stop-daemon --start --quiet --pidfile \ | ||
/opt/nginx/logs/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS || true | ||
echo "$NAME." | ||
;; | ||
reload) | ||
echo -n "Reloading $DESC configuration: " | ||
start-stop-daemon --stop --signal HUP --quiet --pidfile /opt/nginx/logs/$NAME.pid \ | ||
--exec $DAEMON || true | ||
echo "$NAME." | ||
;; | ||
*) | ||
N=/etc/init.d/$NAME | ||
echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
|
||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/opt/nginx/logs/*.log { | ||
daily | ||
missingok | ||
rotate 52 | ||
compress | ||
delaycompress | ||
notifempty | ||
create 640 root adm | ||
sharedscripts | ||
postrotate | ||
[ ! -f /opt/nginx/logs/nginx.pid ] || kill -USR1 `cat /opt/nginx/logs/nginx.pid` | ||
endscript | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
server { | ||
listen 80; | ||
server_name ext-b2c-sk-test; | ||
access_log /home/application/projects/sk_b2c/testing/shared/log/nginx_access.log; | ||
root /home/application/projects/sk_b2c/testing/current/public; | ||
index index.html index.htm; | ||
|
||
auth_basic "Staging"; | ||
auth_basic_user_file staging.sk.htpasswd; | ||
|
||
# passenger stuff | ||
passenger_enabled on; | ||
rails_env production; | ||
rails_spawn_method smart-lv2; | ||
rails_framework_spawner_idle_time 1800; | ||
rails_app_spawner_idle_time 600; | ||
|
||
#location ~* ^/(javascripts|stylesheets|images/layout|images/colorbox|digital_contents) { | ||
# expires max; | ||
#} | ||
#location /data/pricelists { | ||
# root /home/application/projects/s_k/staging/shared; | ||
# internal; | ||
#} | ||
location /stylesheets/adva_core { | ||
proxy_set_header X-Sendfile-Type X-Accel-Redirect; | ||
alias /home/application/.bundle/ruby/1.8/bundler/gems/adva-cms2-75981a8194b3a07e833796d5110aa9d2b450dfbd-master/adva-core/public; | ||
internal; | ||
} | ||
|
||
# For the app maintenance | ||
if (-f $document_root/system/maintenance.html) { | ||
rewrite ^(.*)$ /system/maintenance.html break; | ||
return 503; | ||
} | ||
} | ||
|
||
#server { | ||
# listen 443; | ||
# server_name ext-con-sk-test.siewert-kau.de; | ||
# access_log /home/application/projects/s_k/staging/shared/log/nginx_access.log; | ||
# root /home/application/projects/s_k/staging/current/public; | ||
# index index.html index.htm; | ||
# | ||
# auth_basic "Staging"; | ||
# auth_basic_user_file staging.sk.htpasswd; | ||
# | ||
# # passenger stuff | ||
# passenger_enabled on; | ||
# rails_env staging; | ||
# rails_spawn_method smart-lv2; | ||
# rails_framework_spawner_idle_time 1800; | ||
# rails_app_spawner_idle_time 600; | ||
# | ||
# ssl on; | ||
# ssl_certificate /home/application/.ssh/siewert-kau.de.chained.crt; | ||
# ssl_certificate_key /home/application/.ssh/siewert-kau.de.key; | ||
# | ||
# location ~* ^/(javascripts|stylesheets|images/layout|images/colorbox|digital_contents) { | ||
# expires max; | ||
# } | ||
# location /data/pricelists { | ||
# root /home/application/projects/s_k/staging/shared; | ||
# internal; | ||
# } | ||
# | ||
# # For the app maintenance | ||
# if (-f $document_root/system/maintenance.html) { | ||
# rewrite ^(.*)$ /system/maintenance.html break; | ||
# } | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
server { | ||
listen 80; | ||
server_name ext-b2c-sk-test; | ||
access_log /home/application/projects/sk_b2c/testing/shared/log/nginx_access.log; | ||
root /home/application/projects/sk_b2c/testing/current/public; | ||
index index.html index.htm; | ||
|
||
auth_basic "Staging"; | ||
auth_basic_user_file staging.sk.htpasswd; | ||
|
||
# passenger stuff | ||
passenger_enabled on; | ||
rails_env production; | ||
rails_spawn_method smart-lv2; | ||
rails_framework_spawner_idle_time 1800; | ||
rails_app_spawner_idle_time 600; | ||
|
||
#location ~* ^/(javascripts|stylesheets|images/layout|images/colorbox|digital_contents) { | ||
# expires max; | ||
#} | ||
#location /data/pricelists { | ||
# root /home/application/projects/s_k/staging/shared; | ||
# internal; | ||
#} | ||
location /stylesheets/adva_core { | ||
proxy_set_header X-Sendfile-Type X-Accel-Redirect; | ||
alias /home/application/.bundle/ruby/1.8/bundler/gems/adva-cms2-75981a8194b3a07e833796d5110aa9d2b450dfbd-master/adva-core/public; | ||
internal; | ||
} | ||
|
||
# For the app maintenance | ||
if (-f $document_root/system/maintenance.html) { | ||
rewrite ^(.*)$ /system/maintenance.html break; | ||
return 503; | ||
} | ||
} | ||
|
||
#server { | ||
# listen 443; | ||
# server_name ext-con-sk-test.siewert-kau.de; | ||
# access_log /home/application/projects/s_k/staging/shared/log/nginx_access.log; | ||
# root /home/application/projects/s_k/staging/current/public; | ||
# index index.html index.htm; | ||
# | ||
# auth_basic "Staging"; | ||
# auth_basic_user_file staging.sk.htpasswd; | ||
# | ||
# # passenger stuff | ||
# passenger_enabled on; | ||
# rails_env staging; | ||
# rails_spawn_method smart-lv2; | ||
# rails_framework_spawner_idle_time 1800; | ||
# rails_app_spawner_idle_time 600; | ||
# | ||
# ssl on; | ||
# ssl_certificate /home/application/.ssh/siewert-kau.de.chained.crt; | ||
# ssl_certificate_key /home/application/.ssh/siewert-kau.de.key; | ||
# | ||
# location ~* ^/(javascripts|stylesheets|images/layout|images/colorbox|digital_contents) { | ||
# expires max; | ||
# } | ||
# location /data/pricelists { | ||
# root /home/application/projects/s_k/staging/shared; | ||
# internal; | ||
# } | ||
# | ||
# # For the app maintenance | ||
# if (-f $document_root/system/maintenance.html) { | ||
# rewrite ^(.*)$ /system/maintenance.html break; | ||
# } | ||
#} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
worker_processes 1; | ||
|
||
#error_log logs/error.log; | ||
#pid logs/nginx.pid; | ||
|
||
events { | ||
worker_connections 1024; | ||
} | ||
|
||
http { | ||
server_tokens off; | ||
passenger_root /opt/ruby-ee/lib/ruby/gems/1.8/gems/passenger-2.2.14; | ||
passenger_ruby /opt/ruby-ee/bin/ruby; | ||
passenger_max_pool_size 8; | ||
#passenger_root /usr/lib/ruby/gems/1.8/gems/passenger-2.2.8; | ||
#passenger_ruby /usr/bin/ruby1.8; | ||
|
||
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; | ||
|
||
server_names_hash_bucket_size 128; | ||
|
||
sendfile on; | ||
tcp_nopush on; | ||
keepalive_timeout 65; | ||
tcp_nodelay on; | ||
|
||
gzip on; | ||
gzip_http_version 1.1; | ||
gzip_comp_level 3; | ||
gzip_proxied any; | ||
gzip_types text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript; | ||
|
||
# make sure gzip does not lose large gzipped js or css files | ||
# see http://blog.leetsoft.com/2007/7/25/nginx-gzip-ssl | ||
gzip_buffers 16 8k; | ||
gzip_disable "MSIE [1-6].(?!.*SV1)"; | ||
|
||
include /opt/nginx/conf/sites-enabled/*; | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
advademo:cZmlwfKQj4NTg |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.