change where php code is located

change where php code is located

# Redirect all HTTP trafic to HTTPS

server {
    listen 80;
    listen [::]:80;

    server_name tapcrate.com www.tapcrate.com api.tapcrate.com www.api.tapcrate.com static.tapcrate.com www.static.tapcrate.com beta.tapcrate.com www.beta.tapcrate.com;

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /tmp/letsencrypt-auto/;
    }

    location = /.well-known/acme-challenge/ {
        return 404;
    }

    location / {
        return 301 https://$server_name$request_uri;
    }
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    include snippets/ssl-tapcrate.com.conf;
    include snippets/ssl-params.conf;

    server_name tapcrate.com www.tapcrate.com;

    root /home/hakon/tapcrate-web;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        include snippets/gzip.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api;

    server_name api.tapcrate.com www.api.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-beta.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-development-api;

    server_name beta.tapcrate.com www.beta.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8081;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api/Public;

    server_name static.tapcrate.com www.static.tapcrate.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        include snippets/gzip.conf;

        proxy_cache static;
        try_files $uri =404;
    }
}

# Redirect all HTTP trafic to HTTPS

server {
    listen 80;
    listen [::]:80;

    server_name tapcrate.com www.tapcrate.com api.tapcrate.com www.api.tapcrate.com static.tapcrate.com www.static.tapcrate.com beta.tapcrate.com www.beta.tapcrate.com;

    location ^~ /.well-known/acme-challenge/ {
        default_type "text/plain";
        root /tmp/letsencrypt-auto/;
    }

    location = /.well-known/acme-challenge/ {
        return 404;
    }

    location / {
        return 301 https://$server_name$request_uri;
    }
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    include snippets/ssl-tapcrate.com.conf;
    include snippets/ssl-params.conf;

    server_name tapcrate.com www.tapcrate.com;

    root /var/www/html;
    index index.php index.html;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        include snippets/gzip.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api;

    server_name api.tapcrate.com www.api.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-beta.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-development-api;

    server_name beta.tapcrate.com www.beta.tapcrate.com;

    location / {
        include proxy_params;
        include snippets/gzip.conf;
        proxy_pass http://127.0.0.1:8081;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    include snippets/ssl-api.tapcrate.com.conf;
    include snippets/ssl-params.conf;

    root /home/hakon/tapcrate-api/Public;

    server_name static.tapcrate.com www.static.tapcrate.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        include snippets/gzip.conf;

        proxy_cache static;
        try_files $uri =404;
    }
}


* Added commented section on explicit scratch file placement.


update production projects Nginx config file with new root dir location

#projects.revolutionanalytics.com
#Chris Mosetick
#last update: 2014-11-18

server {
        #listen on IPv4 and IPv6 addresses at the same time
        listen 80;
        listen [::]:80;

        #directory in the file system to serve web pages from
        root /home/mran-user/jenkins/workspace/raprojects-production-build/dist;
        index index.html index.htm;

        # public facing domain name for this vhost
        server_name projects.revolutionanalytics.com;

	access_log /var/log/nginx/projects.revolutionanalytics.com.log;
        error_log /var/log/nginx/error-projects.revolutionanalytics.com.log;

	#define error page parameters here
        error_page 404 /404/index.html;
        #prevent loading error pages directly
        location  /404/index.html { internal; }

}
#this last bracket is needed to close this vhost

#projects.revolutionanalytics.com
#Chris Mosetick
#last update    2014-10-07

server {
        #listen on IPv4 and IPv6 addresses at the same time
        listen 80;
        listen [::]:80;

        #directory in the file system to serve web pages from
        root /home/mran-user/src/OSS-site/dist;
        index index.html index.htm;

        # public facing domain name for this vhost
        server_name projects.revolutionanalytics.com;

	access_log /var/log/nginx/projects.revolutionanalytics.com.log;
        error_log /var/log/nginx/error-projects.revolutionanalytics.com.log;

	#define error page parameters here
        error_page 404 /404/index.html;
        #prevent loading error pages directly
        location  /404/index.html { internal; }

}
#this last bracket is needed to close this vhost


update polymyr configuration

update polymyr configuration

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    root /home/jasper/polymyr;
    index index.php;

    server_name polymyr.com www.polymyr.com;
    charset utf-8;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
                allow all;
    }
}

server {
    listen 80;
    listen [::]:80;

    server_name api.polymyr.com www.api.polymyr.com;
    charset utf-8;

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 80;
    listen [::]:80;

    root /home/hakon/polymyr/polymyr-dev-api/Public/;

    server_name static.polymyr.com www.static.polymyr.com;
    charset utf-8;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files $uri =404;
    }

    location ~ /.well-known {
                allow all;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    root /home/jasper/polymyr;
    index index.php;

    server_name polymyr.com www.polymyr.com;
    charset utf-8;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }
}

server {
    listen 80;
    listen [::]:80;

    server_name api.polymyr.com www.api.polymyr.com;
    charset utf-8;

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }
}

server {
    listen 80;
    listen [::]:80;

    root /home/hakon/polymyr/polymyr-dev-api/Public/;

    server_name static.polymyr.com www.static.polymyr.com;
    charset utf-8;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files $uri =404;
    }
}


update

update

# Redirect all HTTP trafic to HTTPS

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name polymyr.com www.polymyr.com;
    return 301 https://$server_name$request_uri;
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    server_name polymyr.com www.polymyr.com;

    include snippets/ssl-polymyr.com.conf;
    include snippets/ssl-params.conf;

    root /home/jasper/polymyr;
    index index.php;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
        allow all;
    }
}

server {

    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name api.polymyr.com www.api.polymyr.com;

    location ~ /.well-known {
        allow all;
        try_files $uri =404;
    }

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name static.polymyr.com www.static.polymyr.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files Public/$uri =404;
    }

    location ~ /.well-known {
        allow all;
    }
}

# Redirect all HTTP trafic to HTTPS

server {
    listen 80 default_server;
    listen [::]:80 default_server;
    server_name polymyr.com www.polymyr.com;
    return 301 https://$server_name$request_uri;
}

server {

    listen 443 ssl http2 default_server;
    listen [::]:443 ssl http2 default_server;

    server_name polymyr.com www.polymyr.com;

    include snippets/ssl-polymyr.com.conf;
    include snippets/ssl-params.conf;

    root /home/jasper/polymyr;
    index index.php;

    location / {
        try_files $uri $uri/ =404;
    }

    location ~ \.php$ {
        include snippets/fastcgi-php.conf;
        fastcgi_pass unix:/run/php/php7.0-fpm.sock;
    }

    location ~ /\.ht {
        deny all;
    }

    location ~ /.well-known {
        allow all;
    }
}

server {

    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name api.polymyr.com www.api.polymyr.com;

    location ~ /.well-known {
        allow all;
        try_files $uri;
    }

    location / {
        include proxy_params;
        proxy_pass http://127.0.0.1:8080;
    }
}

proxy_cache_path /data/nginx/cache levels=1:2 keys_zone=static:10m inactive=60m use_temp_path=off max_size=4g;

server {
    listen 80;
    listen [::]:80;

    # listen 443 ssl http2;
    # listen [::]:443 ssl http2;

    # include snippets/ssl-api.polymyr.com.conf;
    # include snippets/ssl-params.conf;

    root /home/hakon/polymyr/polymyr-dev-api/;

    server_name static.polymyr.com www.static.polymyr.com;

    location / {
        include h5bp/basic.conf;

        tcp_nodelay on;
        keepalive_timeout 65;
        sendfile on;
        tcp_nopush on;
        sendfile_max_chunk 1m;

        proxy_cache static;
        try_files Public/$uri =404;
    }

    location ~ /.well-known {
        allow all;
    }
}