Guest User

Untitled

a guest
Jan 7th, 2013
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.98 KB | None | 0 0
  1. #user nobody;
  2. worker_processes 1;
  3.  
  4. #error_log logs/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7.  
  8. #pid logs/nginx.pid;
  9.  
  10.  
  11. events {
  12. worker_connections 1024;
  13. }
  14.  
  15.  
  16. http {
  17. include mime.types;
  18. default_type application/octet-stream;
  19. proxy_buffer_size 8k;
  20. #log_format main '$remote_addr - $remote_user [$time_local] "$request" '
  21. # '$status $body_bytes_sent "$http_referer" '
  22. # '"$http_user_agent" "$http_x_forwarded_for"';
  23.  
  24. #access_log logs/access.log main;
  25.  
  26. sendfile on;
  27. #tcp_nopush on;
  28.  
  29. #keepalive_timeout 0;
  30. keepalive_timeout 65;
  31.  
  32. #gzip on;
  33.  
  34. limit_req_zone $binary_remote_addr zone=one:10m rate=30r/m;
  35.  
  36. # another virtual host using mix of IP-, name-, and port-based configuration
  37. #
  38. #server {
  39. # listen 8000;
  40. # listen somename:8080;
  41. # server_name somename alias another.alias;
  42.  
  43. # location / {
  44. # root html;
  45. # index index.html index.htm;
  46. # }
  47. #}
  48.  
  49.  
  50. # HTTPS server
  51. #
  52. #server {
  53. # listen 443;
  54. # server_name localhost;
  55.  
  56. # ssl on;
  57. # ssl_certificate cert.pem;
  58. # ssl_certificate_key cert.key;
  59.  
  60. # ssl_session_timeout 5m;
  61.  
  62. # ssl_protocols SSLv2 SSLv3 TLSv1;
  63. # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv2:+EXP;
  64. # ssl_prefer_server_ciphers on;
  65.  
  66. # location / {
  67. # root html;
  68. # index index.html index.htm;
  69. # }
  70. #}
  71.  
  72. client_max_body_size 16m;
  73. log_format isp '$bytes_sent $request_length';
  74. server {
  75. listen 127.0.0.0:80;
  76. server_name mysite.com www.mysite.com;
  77. rewrite ^(/manager/.*)$ https://$host$1 permanent;
  78. error_page 404 = @fallback;
  79. location ~* ^/(webstat/|awstats|webmail/|myadmin/|manimg/) {
  80. proxy_pass http://127.0.0.0:8080;
  81. proxy_redirect http://mysite.com:8080/ /;
  82. proxy_set_header Host $host;
  83. #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  84. proxy_set_header X-Real-IP $remote_addr;
  85. }
  86. location / {
  87. limit_req zone=one burst=8 nodelay;
  88. proxy_pass http://127.0.0.0:8080;
  89. proxy_redirect http://mysite.com:8080/ /;
  90. proxy_set_header Host $host;
  91. #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  92. proxy_set_header X-Real-IP $remote_addr;
  93. }
  94. location ~* ^.+\.(jpg|jpeg|gif|png|svg|js|css|mp3|ogg|mpe?g|avi|zip|gz|bz2?|rar)$ {
  95. root /home/mysite/data/www/mysite.com;
  96. access_log /home/httpd-logs/mysite.com.access.log ;
  97. access_log /home/nginx-logs/mysite isp;
  98. }
  99. location @fallback {
  100. limit_req zone=one burst=8 nodelay;
  101. proxy_pass http://127.0.0.0:8080;
  102. proxy_set_header Host $host;
  103. #proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  104. proxy_set_header X-Real-IP $remote_addr;
  105. }
  106. }
  107. }
Advertisement
Add Comment
Please, Sign In to add comment