Guest User

Untitled

a guest
Oct 27th, 2018
173
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. server {
  2. index index.php;
  3. listen 80;
  4. server_name localhost;
  5. error_log /var/log/nginx/error.log;
  6. access_log /var/log/nginx/access.log;
  7. root /code-admin;
  8.  
  9. location / {
  10. if (-e $request_filename){
  11. rewrite ^/install/?$ /install.php last;
  12. }
  13. rewrite ^/([^/]+)/?$ /profile.php?username=$1 last;
  14. rewrite ^/([^/]+)/([^/]+)/?$ /profile.php?username=$1&view=$2 last;
  15. rewrite ^/([^/]+)/([^/]+)/([^/]+)/?$ /profile.php?username=$1&view=$2&id=$3 last;
  16. }
  17.  
  18. location /static {
  19. rewrite ^/static/([^/]+)/?$ /static.php?url=$1 last;
  20. }
  21.  
  22. location /contacts {
  23. rewrite ^/contacts/?$ /contact.php last;
  24. }
  25.  
  26. location /directory {
  27. rewrite ^/directory/?$ /directory.php last;
  28. rewrite ^/directory/([^/]+)/?$ /directory.php?view=$1 last;
  29. rewrite ^/directory/([^/]+)/([^/]+)/?$ /directory.php?view=$1&page=$2 last;
  30. }
  31.  
  32. location /search {
  33. rewrite ^/search/?$ /search.php last;
  34. rewrite ^/search/hashtag/([^/]+)/?$ /search.php?query=$1&hashtag=1 last;
  35. rewrite ^/search/([^/]+)/?$ /search.php?query=$1&hashtag=0 last;
  36. }
  37.  
  38. location /signin {
  39. rewrite ^/signin/?$ /sign.php?do=in last;
  40. }
  41.  
  42. location /signup {
  43. rewrite ^/signup/?$ /sign.php?do=up last;
  44. }
  45.  
  46. location /signout {
  47. rewrite ^/signout/?$ /sign.php?do=out last;
  48. }
  49.  
  50. location /reset {
  51. rewrite ^/reset/?$ /sign.php?do=reset last;
  52. }
  53.  
  54. location /activation {
  55. rewrite ^/activation/([^/]+)/([^/]+)/?$ /activation.php?id=$1&token=$2 last;
  56. }
  57.  
  58. location /connect {
  59. rewrite ^/connect/([^/]+)/?$ /connect.php?do=connect&provider=$1 last;
  60. }
  61.  
  62. location /revoke {
  63. rewrite ^/revoke/([^/]+)/?$ /connect.php?do=revoke&provider=$1 last;
  64. }
  65.  
  66. location /packages {
  67. rewrite ^/packages/?$ /packages.php last;
  68. }
  69.  
  70. location /started {
  71. rewrite ^/started/?$ /started.php last;
  72. rewrite ^/started/finished?$ /started.php?finished=true last;
  73. }
  74.  
  75. location /messages {
  76. rewrite ^/messages/?$ /messages.php last;
  77. rewrite ^/messages/new?$ /messages.php?view=new last;
  78. rewrite ^/messages/([^/]+)/?$ /messages.php?cid=$1 last;
  79. }
  80.  
  81. location /notifications {
  82. rewrite ^/notifications/?$ /notifications.php last;
  83. }
  84.  
  85. location /settings {
  86. rewrite ^/settings/?$ /settings.php last;
  87. rewrite ^/settings/([^/]+)/?$ /settings.php?view=$1 last;
  88. }
  89.  
  90. location /posts {
  91. rewrite ^/posts/([^/]+)/?$ /post.php?post_id=$1 last;
  92. }
  93.  
  94. location /photos {
  95. rewrite ^/photos/([^/]+)/?$ /photo.php?photo_id=$1 last;
  96. }
  97.  
  98. location /saved {
  99. rewrite ^/saved/?$ /index.php?view=saved last;
  100. }
  101.  
  102. location /ads {
  103. rewrite ^/ads/?$ /ads.php last;
  104. rewrite ^/ads/new?$ /ads.php?view=new last;
  105. rewrite ^/ads/edit/([^/]+)/?$ /ads.php?view=edit&campaign_id=$1 last;
  106. }
  107.  
  108. location /wallet {
  109. rewrite ^/wallet/?$ /ads.php?view=wallet last;
  110. }
  111.  
  112. location /boosted {
  113. rewrite ^/boosted/posts/?$ /index.php?view=boosted_posts last;
  114. rewrite ^/boosted/pages/?$ /index.php?view=boosted_pages last;
  115. }
  116.  
  117. location /people {
  118. rewrite ^/people/?$ /people.php last;
  119. rewrite ^/people/find/?$ /people.php?view=find last;
  120. rewrite ^/people/friend_requests/?$ /people.php?view=friend_requests last;
  121. rewrite ^/people/sent_requests/?$ /people.php?view=sent_requests last;
  122. }
  123.  
  124. location /pages {
  125. rewrite ^/pages/?$ /pages.php last;
  126. rewrite ^/pages/liked/?$ /pages.php?view=liked last;
  127. rewrite ^/pages/manage/?$ /pages.php?view=manage last;
  128. rewrite ^/pages/([^/]+)/?$ /page.php?username=$1 last;
  129. rewrite ^/pages/([^/]+)/([^/]+)/?$ /page.php?username=$1&view=$2 last;
  130. rewrite ^/pages/([^/]+)/([^/]+)/([^/]+)/?$ /page.php?username=$1&view=$2&id=$3 last;
  131. }
  132.  
  133. location /groups {
  134. rewrite ^/groups/?$ /groups.php last;
  135. rewrite ^/groups/joined/?$ /groups.php?view=joined last;
  136. rewrite ^/groups/manage/?$ /groups.php?view=manage last;
  137. rewrite ^/groups/([^/]+)/?$ /group.php?username=$1 last;
  138. rewrite ^/groups/([^/]+)/([^/]+)/?$ /group.php?username=$1&view=$2 last;
  139. rewrite ^/groups/([^/]+)/([^/]+)/([^/]+)/?$ /group.php?username=$1&view=$2&id=$3 last;
  140. }
  141.  
  142. location /events {
  143. rewrite ^/events/?$ /events.php last;
  144. rewrite ^/events/going/?$ /events.php?view=going last;
  145. rewrite ^/events/interested/?$ /events.php?view=interested last;
  146. rewrite ^/events/invited/?$ /events.php?view=invited last;
  147. rewrite ^/events/manage/?$ /events.php?view=manage last;
  148. rewrite ^/events/([^/]+)/?$ /event.php?event_id=$1 last;
  149. rewrite ^/events/([^/]+)/([^/]+)/?$ /event.php?event_id=$1&view=$2 last;
  150. rewrite ^/events/([^/]+)/([^/]+)/([^/]+)/?$ /event.php?event_id=$1&view=$2&id=$3 last;
  151. }
  152.  
  153. location /forums {
  154. rewrite ^/forums/?$ /forums.php last;
  155. rewrite ^/forums/my-threads/?$ /forums.php?view=my-threads last;
  156. rewrite ^/forums/my-replies/?$ /forums.php?view=my-replies last;
  157. rewrite ^/forums/search/?$ /forums.php?view=search last;
  158. rewrite ^/forums/search-results/?$ /forums.php?view=search-results last;
  159. rewrite ^/forums/new-thread/([^/]+)/?$ /forums.php?view=new-thread&forum_id=$1 last;
  160. rewrite ^/forums/edit-thread/([^/]+)/?$ /forums.php?view=edit-thread&thread_id=$1 last;
  161. rewrite ^/forums/new-reply/([^/]+)/?$ /forums.php?view=new-reply&thread_id=$1 last;
  162. rewrite ^/forums/edit-reply/([^/]+)/?$ /forums.php?view=edit-reply&reply_id=$1 last;
  163. rewrite ^/forums/thread/([^/]+)/([^/]+)/?$ /forums.php?view=thread&thread_id=$1 last;
  164. rewrite ^/forums/([^/]+)/([^/]+)/?$ /forums.php?view=forum&forum_id=$1 last;
  165. }
  166.  
  167. location /articles {
  168. rewrite ^/articles/?$ /index.php?view=articles last;
  169. }
  170.  
  171. location /blogs {
  172. rewrite ^/blogs/?$ /blogs.php last;
  173. rewrite ^/blogs/new/?$ /blogs.php?view=new last;
  174. rewrite ^/blogs/edit/([^/]+)/?$ /blogs.php?view=edit&post_id=$1 last;
  175. rewrite ^/blogs/category/([^/]+)/([^/]+)/?$ /blogs.php?view=category&category_id=$1 last;
  176. rewrite ^/blogs/([^/]+)/([^/]+)/?$ /blogs.php?view=article&post_id=$1 last;
  177. }
  178.  
  179. location /products {
  180. rewrite ^/products/?$ /index.php?view=products last;
  181. }
  182.  
  183. location /market {
  184. rewrite ^/market/?$ /market.php last;
  185. rewrite ^/market/search/?$ /market.php?view=search last;
  186. rewrite ^/market/search/([^/]+)/?$ /market.php?view=search&query=$1 last;
  187. rewrite ^/market/search/([^/]+)/([^/]+)/?$ /market.php?view=search&query=$1&page=$2 last;
  188. rewrite ^/market/category/([^/]+)/?$ /market.php?view=category&category_id=$1 last;
  189. rewrite ^/market/category/([^/]+)/([^/]+)/?$ /market.php?view=category&category_id=$1&category_url=$2 last;
  190. rewrite ^/market/category/([^/]+)/([^/]+)/([^/]+)/?$ /market.php?view=category&category_id=$1&category_url=$2&page=$3 last;
  191. rewrite ^/market/([^/]+)/?$ /market.php?page=$1 last;
  192. }
  193.  
  194. location /games {
  195. rewrite ^/games/?$ /games.php last;
  196. rewrite ^/games/played/?$ /games.php?view=played last;
  197. rewrite ^/games/([^/]+)/?$ /game.php?id=$1 last;
  198. }
  199.  
  200. location /admincp {
  201. rewrite ^/admincp/?$ /admin.php last;
  202. rewrite ^/admincp/([^/]+)/?$ /admin.php?view=$1 last;
  203. rewrite ^/admincp/([^/]+)/([^/]+)/?$ /admin.php?view=$1&sub_view=$2 last;
  204. rewrite ^/admincp/([^/]+)/([^/]+)/([^/]+)/?$ /admin.php?view=$1&sub_view=$2&id=$3 last;
  205. }
  206.  
  207. location ~ \.php$ {
  208. fastcgi_split_path_info ^(.+\.php)(/.+)$;
  209. fastcgi_pass php:9000;
  210. fastcgi_index index.php;
  211. include fastcgi_params;
  212. fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
  213. fastcgi_param PATH_INFO $fastcgi_path_info;
  214. }
  215.  
  216.  
  217. }
RAW Paste Data