Advertisement
Guest User

Untitled

a guest
Oct 16th, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.01 KB | None | 0 0
  1. server {
  2. listen 80;
  3. server_name mereommig.dk;
  4. return 301 https://$host$request_uri;
  5. }
  6.  
  7. server {
  8. server_name mereommig.dk;
  9.  
  10. location / {
  11. root /var/www/mereommig-app/dist-live;
  12. try_files $uri $uri/ @expressapp;
  13.  
  14. expires max;
  15. access_log off;
  16. }
  17.  
  18. location = / {
  19. return 301 https://mereommig.dk/da/forsiden;
  20. }
  21.  
  22. location /api {
  23. alias /var/www/mereommig;
  24. index index.php index.html index.htm;
  25. try_files $uri $uri/ /index.php?$query_string;
  26.  
  27. ## Check for file existing and if there, stop ##
  28. if (-f $request_filename) {
  29. break;
  30. }
  31.  
  32. ## Check for file existing and if there, stop ##
  33. if (-d $request_filename) {
  34. break;
  35. }
  36.  
  37. ## If we get here then there is no file or directory matching request_filename ##
  38. rewrite (.*) /index.php?$query_string;
  39.  
  40. location ~ /api/(.*\.php)(/.*)?$ {
  41. #return 200 $document_root$fastcgi_script_name;
  42. include fastcgi_params;
  43. fastcgi_param SCRIPT_FILENAME $request_filename;
  44. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  45. }
  46. }
  47.  
  48.  
  49. location @expressapp {
  50. proxy_http_version 1.1;
  51. proxy_set_header Upgrade $http_upgrade;
  52. proxy_set_header Connection 'upgrade';
  53. proxy_set_header Host $host;
  54. proxy_cache_bypass $http_upgrade;
  55. proxy_pass http://localhost:3000;
  56. }
  57.  
  58. listen 443 ssl; # managed by Certbot
  59. ssl_certificate /etc/letsencrypt/live/mereommig.dk/fullchain.pem; # managed by Certbot
  60. ssl_certificate_key /etc/letsencrypt/live/mereommig.dk/privkey.pem; # managed by Certbot
  61. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  62. ssl_dhparam /etc/ssl/certs/dhparam.pem;
  63. }
  64.  
  65. server {
  66. server_name www.mereommig.dk;
  67. return 301 https://mereommig.dk$request_uri;
  68. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement