Advertisement
Guest User

nginxapache

a guest
Feb 19th, 2013
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 6.79 KB | None | 0 0
  1. mods-available/rpaf.conf
  2. ------------------------------------------------------------------------------------
  3. <IfModule mod_rpaf.c>
  4. RPAFenable On
  5. RPAFsethostname On
  6. RPAFproxy_ips 127.0.0.1 your-IP-address
  7. </IfModule>
  8. --------------------------------------------------------------------------------------------
  9. nginx.conf
  10. -------------------------------------------------------------------------------------------
  11. # smart default nginx (Ubuntu 7.10)
  12.  
  13. user www-data www-data;
  14. worker_processes 3;
  15.  
  16. error_log /var/log/nginx/error.log warn;
  17. pid /var/run/nginx.pid;
  18.  
  19. events {
  20. worker_connections 1024;
  21. use epoll;
  22. }
  23.  
  24. http {
  25. # allow long server names
  26. server_names_hash_bucket_size 64;
  27.  
  28. include /etc/nginx/mime.types;
  29. default_type application/octet-stream;
  30.  
  31. log_format main '$remote_addr - $remote_user [$time_local] '
  32. '"$request" $status $body_bytes_sent "$http_referer" '
  33. '"$http_user_agent" "$http_x_forwarded_for"';
  34.  
  35. access_log /var/log/nginx/access.log;
  36.  
  37. # spool uploads to disk instead of clobbering downstream servers
  38. client_body_temp_path /var/spool/nginx-client-body 1 2;
  39. client_max_body_size 32m;
  40. client_body_buffer_size 128k;
  41.  
  42. server_tokens off;
  43.  
  44. sendfile on;
  45. tcp_nopush on;
  46. tcp_nodelay off;
  47.  
  48. keepalive_timeout 5;
  49.  
  50. ## Compression
  51. gzip on;
  52. gzip_http_version 1.0;
  53. gzip_comp_level 2;
  54. gzip_proxied any;
  55. gzip_min_length 1100;
  56. gzip_buffers 16 8k;
  57. gzip_types text/plain text/html text/css application/x-javascript \
  58. text/xml application/xml application/xml+rss text/javascript;
  59. # Some version of IE 6 don't handle compression well on some mime-types,
  60. # so just disable for them
  61. gzip_disable "MSIE [1-6].(?!.*SV1)";
  62. # Set a vary header so downstream proxies don't send cached gzipped
  63. # content to IE6
  64. gzip_vary on;
  65.  
  66. # proxy settings
  67. proxy_redirect off;
  68.  
  69. proxy_set_header Host $host;
  70. proxy_set_header X-Real-IP $remote_addr;
  71. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  72. proxy_max_temp_file_size 0;
  73.  
  74. proxy_connect_timeout 90;
  75. proxy_send_timeout 90;
  76. proxy_read_timeout 90;
  77.  
  78. proxy_buffer_size 4k;
  79. proxy_buffers 4 32k;
  80. proxy_busy_buffers_size 64k;
  81. proxy_temp_file_write_size 64k;
  82.  
  83. include /etc/nginx/sites-enabled/*;
  84.  
  85. }
  86.  
  87. --------------------------------------------------------------------------------------------
  88. yourdomain.com.conf (put this file in /etc/nginx/sites-enabled)
  89. -------------------------------------------------------------------------------------------
  90. server {
  91. listen 80;
  92. server_name yourdomain.com www.yourdomain.com;
  93. root /var/www/clients/client0/web2/web;
  94. access_log off;
  95. error_log off;
  96.  
  97. # proxy to Apache 2 and mod_python
  98. location / {
  99. proxy_pass http://127.0.0.1:8080/;
  100. proxy_redirect off;
  101.  
  102. proxy_set_header Host $host;
  103. proxy_set_header X-Real-IP $remote_addr;
  104. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  105. proxy_max_temp_file_size 0;
  106.  
  107. client_max_body_size 10m;
  108. client_body_buffer_size 128k;
  109.  
  110. proxy_connect_timeout 90;
  111. proxy_send_timeout 90;
  112. proxy_read_timeout 90;
  113.  
  114. proxy_buffer_size 4k;
  115. proxy_buffers 4 32k;
  116. proxy_busy_buffers_size 64k;
  117. proxy_temp_file_write_size 64k;
  118. }
  119. }
  120.  
  121. -------------------------------------------------------------------------------------------
  122. default (put this file in /etc/nginx/sites-available)
  123. --------------------------------------------------------------------------------------------
  124. # You may add here your
  125. # server {
  126. # ...
  127. # }
  128. # statements for each of your virtual hosts to this file
  129.  
  130. ##
  131. # You should look at the following URL's in order to grasp a solid understanding
  132. # of Nginx configuration files in order to fully unleash the power of Nginx.
  133. # http://wiki.nginx.org/Pitfalls
  134. # http://wiki.nginx.org/QuickStart
  135. # http://wiki.nginx.org/Configuration
  136. #
  137. # Generally, you will want to move this file somewhere, and start with a clean
  138. # file but keep this around for reference. Or just disable in sites-enabled.
  139. #
  140. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  141. ##
  142.  
  143. server {
  144. #listen 80; ## listen for ipv4; this line is default and implied
  145. #listen [::]:80 default_server ipv6only=on; ## listen for ipv6
  146.  
  147. root /usr/share/nginx/html;
  148. index index.html index.htm;
  149.  
  150. # Make site accessible from http://localhost/
  151. server_name localhost;
  152.  
  153. location / {
  154. # First attempt to serve request as file, then
  155. # as directory, then fall back to displaying a 404.
  156. try_files $uri $uri/ /index.html;
  157. # Uncomment to enable naxsi on this location
  158. # include /etc/nginx/naxsi.rules
  159. }
  160.  
  161. location /doc/ {
  162. alias /usr/share/doc/;
  163. autoindex on;
  164. allow 127.0.0.1;
  165. allow ::1;
  166. deny all;
  167. }
  168.  
  169. # Only for nginx-naxsi used with nginx-naxsi-ui : process denied requests
  170. #location /RequestDenied {
  171. # proxy_pass http://127.0.0.1:8080;
  172. #}
  173.  
  174. #error_page 404 /404.html;
  175.  
  176. # redirect server error pages to the static page /50x.html
  177. #
  178. #error_page 500 502 503 504 /50x.html;
  179. #location = /50x.html {
  180. # root /usr/share/nginx/html;
  181. #}
  182.  
  183. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  184. #
  185. #location ~ \.php$ {
  186. # fastcgi_split_path_info ^(.+\.php)(/.+)$;
  187. # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
  188. #
  189. # # With php5-cgi alone:
  190. # fastcgi_pass 127.0.0.1:9000;
  191. # # With php5-fpm:
  192. # fastcgi_pass unix:/var/run/php5-fpm.sock;
  193. # fastcgi_index index.php;
  194. # include fastcgi_params;
  195. #}
  196.  
  197. # deny access to .htaccess files, if Apache's document root
  198. # concurs with nginx's one
  199. #
  200. #location ~ /\.ht {
  201. # deny all;
  202. #}
  203. }
  204.  
  205.  
  206. # another virtual host using mix of IP-, name-, and port-based configuration
  207. #
  208. #server {
  209. # listen 8000;
  210. # listen somename:8080;
  211. # server_name somename alias another.alias;
  212. # root html;
  213. # index index.html index.htm;
  214. #
  215. # location / {
  216. # try_files $uri $uri/ =404;
  217. # }
  218. #}
  219.  
  220.  
  221. # HTTPS server
  222. #
  223. #server {
  224. # listen 443;
  225. # server_name localhost;
  226. #
  227. # root html;
  228. # index index.html index.htm;
  229. #
  230. # ssl on;
  231. # ssl_certificate cert.pem;
  232. # ssl_certificate_key cert.key;
  233. #
  234. # ssl_session_timeout 5m;
  235. #
  236. # ssl_protocols SSLv3 TLSv1;
  237. # ssl_ciphers ALL:!ADH:!EXPORT56:RC4+RSA:+HIGH:+MEDIUM:+LOW:+SSLv3:+EXP;
  238. # ssl_prefer_server_ciphers on;
  239. #
  240. # location / {
  241. # try_files $uri $uri/ =404;
  242. # }
  243. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement