Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- server {
- listen 80;
- server_name mereommig.dk;
- return 301 https://$host$request_uri;
- }
- server {
- server_name mereommig.dk;
- location / {
- root /var/www/mereommig-app/dist-live;
- try_files $uri $uri/ @expressapp;
- expires max;
- access_log off;
- }
- location = / {
- return 301 https://mereommig.dk/da/forsiden;
- }
- location /api {
- alias /var/www/mereommig;
- index index.php index.html index.htm;
- try_files $uri $uri/ /index.php?$query_string;
- ## Check for file existing and if there, stop ##
- if (-f $request_filename) {
- break;
- }
- ## Check for file existing and if there, stop ##
- if (-d $request_filename) {
- break;
- }
- ## If we get here then there is no file or directory matching request_filename ##
- rewrite (.*) /index.php?$query_string;
- location ~ /api/(.*\.php)(/.*)?$ {
- #return 200 $document_root$fastcgi_script_name;
- include fastcgi_params;
- fastcgi_param SCRIPT_FILENAME $request_filename;
- fastcgi_pass unix:/run/php/php7.0-fpm.sock;
- }
- }
- location @expressapp {
- proxy_http_version 1.1;
- proxy_set_header Upgrade $http_upgrade;
- proxy_set_header Connection 'upgrade';
- proxy_set_header Host $host;
- proxy_cache_bypass $http_upgrade;
- proxy_pass http://localhost:3000;
- }
- listen 443 ssl; # managed by Certbot
- ssl_certificate /etc/letsencrypt/live/mereommig.dk/fullchain.pem; # managed by Certbot
- ssl_certificate_key /etc/letsencrypt/live/mereommig.dk/privkey.pem; # managed by Certbot
- include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
- ssl_dhparam /etc/ssl/certs/dhparam.pem;
- }
- server {
- server_name www.mereommig.dk;
- return 301 https://mereommig.dk$request_uri;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement