pbp_com.nginx 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. server {
  2. server_name www.penobscotbaypress.com new.penobscotbaypress.com;
  3. rewrite ^(.*) https://penobscotbaypress.com$1 permanent;
  4. }
  5. server {
  6. server_name directory.penobscotbaypress.com;
  7. rewrite ^(.*) https://penobscotbaypress.com/directory$1 permanent;
  8. }
  9. server {
  10. server_name store.penobscotbaypress.com;
  11. rewrite ^(.*) https://penobscotbaypress.com/store/ permanent;
  12. }
  13. server {
  14. listen 80;
  15. server_name penobscotbaypress.com;
  16. rewrite ^(.*) https://penobscotbaypress.com$1 permanent;
  17. }
  18. server {
  19. # listen 80;
  20. listen 443 ssl;
  21. server_name penobscotbaypress.com new.penobscotbaypress.com;
  22. ssl on;
  23. ssl_certificate /etc/nginx/penobscotbaypress.com.chained.crt;
  24. ssl_certificate_key /etc/nginx/penobscotbaypress.key;
  25. ssl_ciphers RC4:HIGH:!aNULL:!MD5;
  26. ssl_prefer_server_ciphers on;
  27. access_log /var/log/nginx/pbp.access.log;
  28. location /robots.txt {
  29. alias /var/lib/django/pbp_com/templates/robots.txt;
  30. }
  31. location /images/headers/iaflaground440.gif {
  32. rewrite /images/headers/iaflaground440.gif http://penobscotbaypress.com/media/images/headers/iaflaground440.gif permanent;
  33. }
  34. location /index.html {
  35. rewrite /index.html http://penobscotbaypress.com/ permanent;
  36. }
  37. location /penobscotbaypress.xml {
  38. rewrite /penobscotbaypress.xml http://penobscotbaypress.com/news/feed.xml permanent;
  39. }
  40. location /webcam/iawebcam.html {
  41. rewrite /webcam/iawebcam.html http://penobscotbaypress.com/multimedia/webcams/stonington/ permanent;
  42. }
  43. location /webcam/pbpcam.jpg {
  44. rewrite /webcam/pbpcam.jpg http://webcam.penobscotbaypress.com/pbpcam.jpg permanent;
  45. }
  46. location /webcam/wpwebcam.html {
  47. rewrite /webcam/wpwebcam.html http://penobscotbaypress.com/multimedia/webcams/blue-hill/ permanent;
  48. }
  49. location /store/shoppingcart.html {
  50. rewrite /store/shoppingcart.html http://penobscotbaypress.com/store/ permanent;
  51. }
  52. location /store/wishlist.html {
  53. rewrite /store/wishlist.html http://penobscotbaypress.com/store/ permanent;
  54. }
  55. location /store/help.html {
  56. rewrite /store/help.html http://penobscotbaypress.com/store/ permanent;
  57. }
  58. location /store/privacy.html {
  59. rewrite /store/privacy.html http://penobscotbaypress.com/store/ permanent;
  60. }
  61. location /classifieds/compassclassifieds.html {
  62. rewrite /classifieds/compassclassifieds.html http://penobscotbaypress.com/classifieds/ permanent;
  63. }
  64. location /communityinformation/remembrances/deathannouncements.html {
  65. rewrite /communityinformation/remembrances/deathannouncements.html http://penobscotbaypress.com/remembrances/death-announcements/ permanent;
  66. }
  67. location /communityinformation/towninformation/deerisle.html {
  68. rewrite /communityinformation/towninformation/deerisle.html http://penobscotbaypress.com/community-info/towns/deer-isle/ permanent;
  69. }
  70. location /captainsquarters/* {
  71. rewrite /captainsquarters/ http://penobscotbaypress.com/news/archives/ permanent;
  72. }
  73. location /captainsquarters/ {
  74. rewrite /captainsquarters/ http://penobscotbaypress.com/news/archives/ permanent;
  75. }
  76. location /admin/orders_admin.html {
  77. rewrite /admin/orders_admin.html http://old.penobscotbaypress.com/admin/orders_admin.html permanent;
  78. }
  79. location /calendar/communitycalendar.html {
  80. rewrite /calendar/communitycalendar.html http://calendar.penobscotbaypress.com permanent;
  81. }
  82. location /communitynews/ {
  83. rewrite /communitynews/.* http://old.penobscotbaypress.com/communitynews/$1 redirect;
  84. }
  85. location /images/ {
  86. rewrite ^(/images/.*) http://old.penobscotbaypress.com/$1 redirect;
  87. }
  88. location /styles.css {
  89. rewrite /styles.css http://old.penobscotbaypress.com/styles.css redirect;
  90. }
  91. location /store/images/ {
  92. rewrite /store/images/ http://old.penobscotbaypres.com/store/images/ permanent;
  93. }
  94. location /store/books/ {
  95. rewrite ^(.*) http://penbaypress.me/ permanent;
  96. }
  97. location /cgi-bin/redirect.pl {
  98. rewrite /cgi-bin/redirect.pl http://old.penobscotbaypress.com/cgi-bin/redirect.pl permanent;
  99. }
  100. # added for admin static files
  101. location /static/ {
  102. alias /var/lib/django/pbp_com/static_collected/;
  103. }
  104. # site_media - folder in uri for static files
  105. location ^~ /media/ {
  106. root /var/lib/django/pbp_com/;
  107. access_log off;
  108. expires 30d;
  109. }
  110. location = /favicon.ico {
  111. rewrite "/favicon.ico" /media/images/favicon.ico;
  112. }
  113. location / {
  114. include /etc/nginx/uwsgi_params;
  115. uwsgi_pass unix:/var/lib/django/run/pbp_com.sock;
  116. }
  117. }