Guest User

Untitled

a guest
Nov 7th, 2013
152
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 24.23 KB | None | 0 0
  1. # You may add here your
  2. # server {
  3. # ...
  4. # }
  5. # statements for each of your virtual hosts
  6.  
  7. server {
  8. listen 80;
  9. server_name www.test.com;
  10. rewrite ^/(.*)$ http://test.com/$1 permanent;
  11. }
  12.  
  13. #server {
  14. # listen 80;
  15. # server_name www.mehta.com;
  16. # rewrite ^/(.*)$ http://mehta.com/$1 permanent;
  17. #}
  18.  
  19. server {
  20. listen 80;
  21. server_name test.com;
  22. access_log /var/log/nginx/localhost.access.log;
  23. error_log /var/log/nginx/error.log;
  24.  
  25. root /usr/share/nginx/www/website;
  26. index index.php;
  27.  
  28. ## serve imagecache files directly or redirect to drupal if they do not exist.
  29. location ~* files/styles {
  30. access_log off;
  31. expires 30d;
  32. try_files $uri @drupal;
  33. }
  34.  
  35. ## serve imagecache files directly or redirect to drupal if they do not exist.
  36. location ~* ^.+.(xsl|xml)$ {
  37. access_log off;
  38. expires 1d;
  39. try_files $uri @drupal;
  40. }
  41.  
  42. ## Default location
  43. location / {
  44. try_files $uri $uri/ @drupal;
  45. index index.php;
  46. }
  47.  
  48. location @drupal {
  49. rewrite ^/(.*)$ /index.php?q=$1 last;
  50. # rewrite ^/(.*)$ index.php last;
  51. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  52. }
  53.  
  54. ## Images and static content is treated different
  55. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  56. access_log off;
  57. expires 30d;
  58. }
  59.  
  60. ## Parse all .php file in the /var/www directory
  61. location ~ .php$ {
  62. include fastcgi_params;
  63. fastcgi_split_path_info ^(.+\.php)(.*)$;
  64. fastcgi_pass backend;
  65. fastcgi_index index.php;
  66. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  67. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  68. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  69. fastcgi_param QUERY_STRING $query_string;
  70. fastcgi_param REQUEST_METHOD $request_method;
  71. fastcgi_param CONTENT_TYPE $content_type;
  72. fastcgi_param CONTENT_LENGTH $content_length;
  73. fastcgi_intercept_errors on;
  74. fastcgi_ignore_client_abort off;
  75. fastcgi_connect_timeout 60;
  76. fastcgi_send_timeout 180;
  77. fastcgi_read_timeout 180;
  78. fastcgi_buffer_size 128k;
  79. fastcgi_buffers 4 256k;
  80. fastcgi_busy_buffers_size 256k;
  81. fastcgi_temp_file_write_size 256k;
  82. }
  83.  
  84. ## Disable viewing .htaccess & .htpassword
  85. location ~ /\.ht {
  86. deny all;
  87. }
  88. }
  89.  
  90. server {
  91. listen 80;
  92. server_name dev.test.com 166.78.119.226;
  93. access_log /var/log/nginx/localhost.access.log;
  94. error_log /var/log/nginx/error.log;
  95.  
  96. root /usr/share/nginx/www;
  97. index index.php;
  98.  
  99. ## serve imagecache files directly or redirect to drupal if they do not exist.
  100. location ~* files/styles {
  101. access_log off;
  102. expires 30d;
  103. try_files $uri @drupal;
  104. }
  105.  
  106. ## serve imagecache files directly or redirect to drupal if they do not exist.
  107. location ~* ^.+.(xsl|xml)$ {
  108. access_log off;
  109. expires 1d;
  110. try_files $uri @drupal;
  111. }
  112.  
  113. ## Default location
  114. location / {
  115. try_files $uri $uri/ @drupal;
  116. index index.php;
  117. }
  118.  
  119. location @drupal {
  120. # rewrite ^/(.*)$ /webdev.com/index.php?q=$1 last;
  121. # rewrite ^/(.*)$ index.php last;
  122. rewrite ^/(.*)/(.*)$ /$1/index.php last;
  123. }
  124.  
  125. ## Images and static content is treated different
  126. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  127. access_log off;
  128. expires 30d;
  129. }
  130.  
  131. ## Parse all .php file in the /var/www directory
  132. location ~ .php$ {
  133. include fastcgi_params;
  134. fastcgi_split_path_info ^(.+\.php)(.*)$;
  135. fastcgi_pass backend;
  136. fastcgi_index index.php;
  137. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  138. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  139. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  140. fastcgi_param QUERY_STRING $query_string;
  141. fastcgi_param REQUEST_METHOD $request_method;
  142. fastcgi_param CONTENT_TYPE $content_type;
  143. fastcgi_param CONTENT_LENGTH $content_length;
  144. fastcgi_intercept_errors on;
  145. fastcgi_ignore_client_abort off;
  146. fastcgi_connect_timeout 60;
  147. fastcgi_send_timeout 180;
  148. fastcgi_read_timeout 180;
  149. fastcgi_buffer_size 128k;
  150. fastcgi_buffers 4 256k;
  151. fastcgi_busy_buffers_size 256k;
  152. fastcgi_temp_file_write_size 256k;
  153. }
  154.  
  155. ## Disable viewing .htaccess & .htpassword
  156. location ~ /\.ht {
  157. deny all;
  158. }
  159. }
  160.  
  161. server {
  162. listen 80;
  163. server_name ghn.test.com;
  164. access_log /var/log/nginx/localhost.access.log;
  165. error_log /var/log/nginx/error.log;
  166.  
  167. root /usr/share/nginx/www/ghn;
  168. index index.php;
  169.  
  170. ## serve imagecache files directly or redirect to drupal if they do not exist.
  171. location ~* files/styles {
  172. access_log off;
  173. expires 30d;
  174. try_files $uri @drupal;
  175. }
  176.  
  177. ## serve imagecache files directly or redirect to drupal if they do not exist.
  178. location ~* ^.+.(xsl|xml)$ {
  179. access_log off;
  180. expires 1d;
  181. try_files $uri @drupal;
  182. }
  183.  
  184. ## Default location
  185. location / {
  186. try_files $uri $uri/ @drupal;
  187. index index.php;
  188. }
  189.  
  190. location @drupal {
  191. rewrite ^/(.*)$ /index.php?q=$1 last;
  192. # rewrite ^/(.*)$ index.php last;
  193. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  194. }
  195.  
  196. ## Images and static content is treated different
  197. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  198. access_log off;
  199. expires 30d;
  200. }
  201.  
  202. ## Parse all .php file in the /var/www directory
  203. location ~ .php$ {
  204. include fastcgi_params;
  205. fastcgi_split_path_info ^(.+\.php)(.*)$;
  206. fastcgi_pass backend;
  207. fastcgi_index index.php;
  208. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  209. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  210. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  211. fastcgi_param QUERY_STRING $query_string;
  212. fastcgi_param REQUEST_METHOD $request_method;
  213. fastcgi_param CONTENT_TYPE $content_type;
  214. fastcgi_param CONTENT_LENGTH $content_length;
  215. fastcgi_intercept_errors on;
  216. fastcgi_ignore_client_abort off;
  217. fastcgi_connect_timeout 60;
  218. fastcgi_send_timeout 180;
  219. fastcgi_read_timeout 180;
  220. fastcgi_buffer_size 128k;
  221. fastcgi_buffers 4 256k;
  222. fastcgi_busy_buffers_size 256k;
  223. fastcgi_temp_file_write_size 256k;
  224. }
  225.  
  226. ## Disable viewing .htaccess & .htpassword
  227. location ~ /\.ht {
  228. deny all;
  229. }
  230. }
  231.  
  232. server {
  233. listen 80;
  234. server_name cle.test.com;
  235. access_log /var/log/nginx/localhost.access.log;
  236. error_log /var/log/nginx/error.log;
  237.  
  238. root /usr/share/nginx/www/cle;
  239. index index.php;
  240.  
  241. ## serve imagecache files directly or redirect to drupal if they do not exist.
  242. location ~* files/styles {
  243. access_log off;
  244. expires 30d;
  245. try_files $uri @drupal;
  246. }
  247.  
  248. ## serve imagecache files directly or redirect to drupal if they do not exist.
  249. location ~* ^.+.(xsl|xml)$ {
  250. access_log off;
  251. expires 1d;
  252. try_files $uri @drupal;
  253. }
  254.  
  255. ## Default location
  256. location / {
  257. try_files $uri $uri/ @drupal;
  258. index index.php;
  259. }
  260.  
  261. location @drupal {
  262. # rewrite ^/(.*)$ /webdev.com/index.php?q=$1 last;
  263. # rewrite ^/(.*)$ index.php last;
  264. rewrite ^/(.*)/(.*)$ /$1/index.php last;
  265. }
  266.  
  267. ## Images and static content is treated different
  268. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  269. access_log off;
  270. expires 30d;
  271. }
  272.  
  273. ## Parse all .php file in the /var/www directory
  274. location ~ .php$ {
  275. include fastcgi_params;
  276. fastcgi_split_path_info ^(.+\.php)(.*)$;
  277. fastcgi_pass backend;
  278. fastcgi_index index.php;
  279. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  280. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  281. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  282. fastcgi_param QUERY_STRING $query_string;
  283. fastcgi_param REQUEST_METHOD $request_method;
  284. fastcgi_param CONTENT_TYPE $content_type;
  285. fastcgi_param CONTENT_LENGTH $content_length;
  286. fastcgi_intercept_errors on;
  287. fastcgi_ignore_client_abort off;
  288. fastcgi_connect_timeout 60;
  289. fastcgi_send_timeout 180;
  290. fastcgi_read_timeout 180;
  291. fastcgi_buffer_size 128k;
  292. fastcgi_buffers 4 256k;
  293. fastcgi_busy_buffers_size 256k;
  294. fastcgi_temp_file_write_size 256k;
  295. }
  296.  
  297. ## Disable viewing .htaccess & .htpassword
  298. location ~ /\.ht {
  299. deny all;
  300. }
  301. }
  302.  
  303. server {
  304. listen 80;
  305. server_name dev2.test.com;
  306. access_log /var/log/nginx/localhost.access.log;
  307. error_log /var/log/nginx/error.log;
  308.  
  309. root /usr/share/nginx/www;
  310. index index.php;
  311.  
  312. ## serve imagecache files directly or redirect to drupal if they do not exist.
  313. location ~* files/styles {
  314. access_log off;
  315. expires 30d;
  316. try_files $uri @drupal;
  317. }
  318.  
  319. ## serve imagecache files directly or redirect to drupal if they do not exist.
  320. location ~* ^.+.(xsl|xml)$ {
  321. access_log off;
  322. expires 1d;
  323. try_files $uri @drupal;
  324. }
  325.  
  326. ## Default location
  327. location / {
  328. try_files $uri $uri/ @drupal;
  329. index index.php;
  330. }
  331.  
  332. location @drupal {
  333. rewrite ^/(.*)/(.*)$ /$1/index.php?q=$2 last;
  334. # rewrite ^/(.*)$ index.php last;
  335. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  336. }
  337.  
  338. ## Images and static content is treated different
  339. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  340. access_log off;
  341. expires 30d;
  342. }
  343.  
  344. ## Parse all .php file in the /var/www directory
  345. location ~ .php$ {
  346. include fastcgi_params;
  347. fastcgi_split_path_info ^(.+\.php)(.*)$;
  348. fastcgi_pass backend;
  349. fastcgi_index index.php;
  350. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  351. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  352. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  353. fastcgi_param QUERY_STRING $query_string;
  354. fastcgi_param REQUEST_METHOD $request_method;
  355. fastcgi_param CONTENT_TYPE $content_type;
  356. fastcgi_param CONTENT_LENGTH $content_length;
  357. fastcgi_intercept_errors on;
  358. fastcgi_ignore_client_abort off;
  359. fastcgi_connect_timeout 60;
  360. fastcgi_send_timeout 180;
  361. fastcgi_read_timeout 180;
  362. fastcgi_buffer_size 128k;
  363. fastcgi_buffers 4 256k;
  364. fastcgi_busy_buffers_size 256k;
  365. fastcgi_temp_file_write_size 256k;
  366. }
  367.  
  368. ## Disable viewing .htaccess & .htpassword
  369. location ~ /\.ht {
  370. deny all;
  371. }
  372. }
  373.  
  374. server {
  375. listen 80;
  376. server_name ecs.test.com;
  377. access_log /var/log/nginx/localhost.access.log;
  378. error_log /var/log/nginx/error.log;
  379.  
  380. root /usr/share/nginx/www/ecs;
  381. index index.php;
  382.  
  383. ## serve imagecache files directly or redirect to drupal if they do not exist.
  384. location ~* files/styles {
  385. access_log off;
  386. expires 30d;
  387. try_files $uri @drupal;
  388. }
  389.  
  390. ## serve imagecache files directly or redirect to drupal if they do not exist.
  391. location ~* ^.+.(xsl|xml)$ {
  392. access_log off;
  393. expires 1d;
  394. try_files $uri @drupal;
  395. }
  396.  
  397. ## Default location
  398. location / {
  399. try_files $uri $uri/ @drupal;
  400. index index.php;
  401. }
  402.  
  403. location @drupal {
  404. rewrite ^/(.*)$ /index.php?q=$1 last;
  405. # rewrite ^/(.*)$ index.php last;
  406. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  407. }
  408.  
  409. ## Images and static content is treated different
  410. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  411. access_log off;
  412. expires 30d;
  413. }
  414.  
  415. ## Parse all .php file in the /var/www directory
  416. location ~ .php$ {
  417. include fastcgi_params;
  418. fastcgi_split_path_info ^(.+\.php)(.*)$;
  419. fastcgi_pass backend;
  420. fastcgi_index index.php;
  421. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  422. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  423. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  424. fastcgi_param QUERY_STRING $query_string;
  425. fastcgi_param REQUEST_METHOD $request_method;
  426. fastcgi_param CONTENT_TYPE $content_type;
  427. fastcgi_param CONTENT_LENGTH $content_length;
  428. fastcgi_intercept_errors on;
  429. fastcgi_ignore_client_abort off;
  430. fastcgi_connect_timeout 60;
  431. fastcgi_send_timeout 180;
  432. fastcgi_read_timeout 180;
  433. fastcgi_buffer_size 128k;
  434. fastcgi_buffers 4 256k;
  435. fastcgi_busy_buffers_size 256k;
  436. fastcgi_temp_file_write_size 256k;
  437. }
  438.  
  439. ## Disable viewing .htaccess & .htpassword
  440. location ~ /\.ht {
  441. deny all;
  442. }
  443. }
  444.  
  445. server {
  446. listen 80;
  447. server_name pw.test.com;
  448. access_log /var/log/nginx/localhost.access.log;
  449. error_log /var/log/nginx/error.log;
  450.  
  451. root /usr/share/nginx/www/pw;
  452. index index.php;
  453.  
  454. ## serve imagecache files directly or redirect to drupal if they do not exist.
  455. location ~* files/styles {
  456. access_log off;
  457. expires 30d;
  458. try_files $uri @drupal;
  459. }
  460.  
  461. ## serve imagecache files directly or redirect to drupal if they do not exist.
  462. location ~* ^.+.(xsl|xml)$ {
  463. access_log off;
  464. expires 1d;
  465. try_files $uri @drupal;
  466. }
  467.  
  468. ## Default location
  469. location / {
  470. try_files $uri $uri/ @drupal;
  471. index index.php;
  472. }
  473.  
  474. location @drupal {
  475. rewrite ^/(.*)$ /index.php?q=$1 last;
  476. # rewrite ^/(.*)$ index.php last;
  477. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  478. }
  479.  
  480. ## Images and static content is treated different
  481. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  482. access_log off;
  483. expires 30d;
  484. }
  485.  
  486. ## Parse all .php file in the /var/www directory
  487. location ~ .php$ {
  488. include fastcgi_params;
  489. fastcgi_split_path_info ^(.+\.php)(.*)$;
  490. fastcgi_pass backend;
  491. fastcgi_index index.php;
  492. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  493. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  494. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  495. fastcgi_param QUERY_STRING $query_string;
  496. fastcgi_param REQUEST_METHOD $request_method;
  497. fastcgi_param CONTENT_TYPE $content_type;
  498. fastcgi_param CONTENT_LENGTH $content_length;
  499. fastcgi_intercept_errors on;
  500. fastcgi_ignore_client_abort off;
  501. fastcgi_connect_timeout 60;
  502. fastcgi_send_timeout 180;
  503. fastcgi_read_timeout 180;
  504. fastcgi_buffer_size 128k;
  505. fastcgi_buffers 4 256k;
  506. fastcgi_busy_buffers_size 256k;
  507. fastcgi_temp_file_write_size 256k;
  508. }
  509.  
  510. ## Disable viewing .htaccess & .htpassword
  511. location ~ /\.ht {
  512. deny all;
  513. }
  514. }
  515.  
  516. server {
  517. listen 80;
  518. server_name ebay-stories.test.com;
  519. access_log /var/log/nginx/localhost.access.log;
  520. error_log /var/log/nginx/error.log;
  521.  
  522. root /usr/share/nginx/www/ebay-stories;
  523. index index.php;
  524.  
  525. ## serve imagecache files directly or redirect to drupal if they do not exist.
  526. location ~* files/styles {
  527. access_log off;
  528. expires 30d;
  529. try_files $uri @drupal;
  530. }
  531.  
  532. ## serve imagecache files directly or redirect to drupal if they do not exist.
  533. location ~* ^.+.(xsl|xml)$ {
  534. access_log off;
  535. expires 1d;
  536. try_files $uri @drupal;
  537. }
  538.  
  539. ## Default location
  540. location / {
  541. try_files $uri $uri/ @drupal;
  542. index index.php;
  543. }
  544.  
  545. location @drupal {
  546. rewrite ^/(.*)$ /index.php?q=$1 last;
  547. # rewrite ^/(.*)$ index.php last;
  548. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  549. }
  550.  
  551. ## Images and static content is treated different
  552. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  553. access_log off;
  554. expires 30d;
  555. }
  556.  
  557. ## Parse all .php file in the /var/www directory
  558. location ~ .php$ {
  559. include fastcgi_params;
  560. fastcgi_split_path_info ^(.+\.php)(.*)$;
  561. fastcgi_pass backend;
  562. fastcgi_index index.php;
  563. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  564. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  565. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  566. fastcgi_param QUERY_STRING $query_string;
  567. fastcgi_param REQUEST_METHOD $request_method;
  568. fastcgi_param CONTENT_TYPE $content_type;
  569. fastcgi_param CONTENT_LENGTH $content_length;
  570. fastcgi_intercept_errors on;
  571. fastcgi_ignore_client_abort off;
  572. fastcgi_connect_timeout 60;
  573. fastcgi_send_timeout 180;
  574. fastcgi_read_timeout 180;
  575. fastcgi_buffer_size 128k;
  576. fastcgi_buffers 4 256k;
  577. fastcgi_busy_buffers_size 256k;
  578. fastcgi_temp_file_write_size 256k;
  579. }
  580.  
  581. ## Disable viewing .htaccess & .htpassword
  582. location ~ /\.ht {
  583. deny all;
  584. }
  585. }
  586.  
  587. server {
  588. listen 80;
  589. server_name interview.test.com;
  590. access_log /var/log/nginx/localhost.access.log;
  591. error_log /var/log/nginx/error.log;
  592.  
  593. root /usr/share/nginx/www/interview;
  594. index index.php;
  595.  
  596. ## serve imagecache files directly or redirect to drupal if they do not exist.
  597. location ~* files/styles {
  598. access_log off;
  599. expires 30d;
  600. try_files $uri @drupal;
  601. }
  602.  
  603. ## serve imagecache files directly or redirect to drupal if they do not exist.
  604. location ~* ^.+.(xsl|xml)$ {
  605. access_log off;
  606. expires 1d;
  607. try_files $uri @drupal;
  608. }
  609.  
  610. ## Default location
  611. location / {
  612. try_files $uri $uri/ @drupal;
  613. index index.php;
  614. }
  615.  
  616. location @drupal {
  617. rewrite ^/(.*)$ /index.php?q=$1 last;
  618. # rewrite ^/(.*)$ index.php last;
  619. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  620. }
  621.  
  622. ## Images and static content is treated different
  623. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  624. access_log off;
  625. expires 30d;
  626. }
  627.  
  628. ## Parse all .php file in the /var/www directory
  629. location ~ .php$ {
  630. include fastcgi_params;
  631. fastcgi_split_path_info ^(.+\.php)(.*)$;
  632. fastcgi_pass backend;
  633. fastcgi_index index.php;
  634. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  635. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  636. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  637. fastcgi_param QUERY_STRING $query_string;
  638. fastcgi_param REQUEST_METHOD $request_method;
  639. fastcgi_param CONTENT_TYPE $content_type;
  640. fastcgi_param CONTENT_LENGTH $content_length;
  641. fastcgi_intercept_errors on;
  642. fastcgi_ignore_client_abort off;
  643. fastcgi_connect_timeout 60;
  644. fastcgi_send_timeout 180;
  645. fastcgi_read_timeout 180;
  646. fastcgi_buffer_size 128k;
  647. fastcgi_buffers 4 256k;
  648. fastcgi_busy_buffers_size 256k;
  649. fastcgi_temp_file_write_size 256k;
  650. }
  651.  
  652. ## Disable viewing .htaccess & .htpassword
  653. location ~ /\.ht {
  654. deny all;
  655. }
  656. }
  657.  
  658. server {
  659. listen 80;
  660. server_name ebay-biz.test.com;
  661. access_log /var/log/nginx/localhost.access.log;
  662. error_log /var/log/nginx/error.log;
  663.  
  664. root /usr/share/nginx/www/ebay-biz;
  665. index index.php;
  666.  
  667. ## serve imagecache files directly or redirect to drupal if they do not exist.
  668. location ~* files/styles {
  669. access_log off;
  670. expires 30d;
  671. try_files $uri @drupal;
  672. }
  673.  
  674. ## serve imagecache files directly or redirect to drupal if they do not exist.
  675. location ~* ^.+.(xsl|xml)$ {
  676. access_log off;
  677. expires 1d;
  678. try_files $uri @drupal;
  679. }
  680.  
  681. ## Default location
  682. location / {
  683. try_files $uri $uri/ @drupal;
  684. index index.php;
  685. }
  686.  
  687. location @drupal {
  688. rewrite ^/(.*)$ /index.php?q=$1 last;
  689. # rewrite ^/(.*)$ index.php last;
  690. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  691. }
  692.  
  693. ## Images and static content is treated different
  694. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  695. access_log off;
  696. expires 30d;
  697. }
  698.  
  699. ## Parse all .php file in the /var/www directory
  700. location ~ .php$ {
  701. include fastcgi_params;
  702. fastcgi_split_path_info ^(.+\.php)(.*)$;
  703. fastcgi_pass backend;
  704. fastcgi_index index.php;
  705. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  706. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  707. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  708. fastcgi_param QUERY_STRING $query_string;
  709. fastcgi_param REQUEST_METHOD $request_method;
  710. fastcgi_param CONTENT_TYPE $content_type;
  711. fastcgi_param CONTENT_LENGTH $content_length;
  712. fastcgi_intercept_errors on;
  713. fastcgi_ignore_client_abort off;
  714. fastcgi_connect_timeout 60;
  715. fastcgi_send_timeout 180;
  716. fastcgi_read_timeout 180;
  717. fastcgi_buffer_size 128k;
  718. fastcgi_buffers 4 256k;
  719. fastcgi_busy_buffers_size 256k;
  720. fastcgi_temp_file_write_size 256k;
  721. }
  722.  
  723. ## Disable viewing .htaccess & .htpassword
  724. location ~ /\.ht {
  725. deny all;
  726. }
  727. }
  728.  
  729. server {
  730. listen 80;
  731. server_name autoweek.test.com;
  732. access_log /var/log/nginx/localhost.access.log;
  733. error_log /var/log/nginx/error.log;
  734.  
  735. root /usr/share/nginx/www/autoweek-dev2;
  736. index index.php;
  737.  
  738. ## serve imagecache files directly or redirect to drupal if they do not exist.
  739. location ~* files/styles {
  740. access_log off;
  741. expires 30d;
  742. try_files $uri @drupal;
  743. }
  744.  
  745. ## serve imagecache files directly or redirect to drupal if they do not exist.
  746. location ~* ^.+.(xsl|xml)$ {
  747. access_log off;
  748. expires 1d;
  749. try_files $uri @drupal;
  750. }
  751.  
  752. ## Default location
  753. location / {
  754. try_files $uri $uri/ @drupal;
  755. index index.php;
  756. }
  757.  
  758. location @drupal {
  759. rewrite ^/(.*)$ /index.php?q=$1 last;
  760. # rewrite ^/(.*)$ index.php last;
  761. # rewrite ^/(.*)/(.*)$ /$1/index.php last;
  762. }
  763.  
  764. ## Images and static content is treated different
  765. location ~* ^.+.(jpg|jpeg|gif|css|png|js|ico|xml)$ {
  766. access_log off;
  767. expires 30d;
  768. }
  769.  
  770. ## Parse all .php file in the /var/www directory
  771. location ~ .php$ {
  772. include fastcgi_params;
  773. fastcgi_split_path_info ^(.+\.php)(.*)$;
  774. fastcgi_pass backend;
  775. fastcgi_index index.php;
  776. #rewrite ^ http://www.google.com?q=$document_root$fastcgi_script_name$query_string;
  777. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  778. fastcgi_param SCRIPT_NAME $fastcgi_script_name;
  779. fastcgi_param QUERY_STRING $query_string;
  780. fastcgi_param REQUEST_METHOD $request_method;
  781. fastcgi_param CONTENT_TYPE $content_type;
  782. fastcgi_param CONTENT_LENGTH $content_length;
  783. fastcgi_intercept_errors on;
  784. fastcgi_ignore_client_abort off;
  785. fastcgi_connect_timeout 60;
  786. fastcgi_send_timeout 180;
  787. fastcgi_read_timeout 180;
  788. fastcgi_buffer_size 128k;
  789. fastcgi_buffers 4 256k;
  790. fastcgi_busy_buffers_size 256k;
  791. fastcgi_temp_file_write_size 256k;
  792. }
  793.  
  794. ## Disable viewing .htaccess & .htpassword
  795. location ~ /\.ht {
  796. deny all;
  797. }
  798. }
  799.  
  800. upstream backend {
  801. server 127.0.0.1:9000;
  802. }
Advertisement
Add Comment
Please, Sign In to add comment