Skip to content

Commit

Permalink
Merge branch 'feat/embed-mode' into 'master'
Browse files Browse the repository at this point in the history
Embed Mode NGINX config

See merge request minds/minds!191
  • Loading branch information
markharding committed Nov 12, 2020
2 parents 40d6e5a + 9ab8e28 commit bd0e6b3
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 6 deletions.
8 changes: 7 additions & 1 deletion containers/nginx/dev-ssr.conf.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ server {
log_not_found off;
}

location /embed-static/ {
alias /var/www/Minds/front/dist/embed/;
expires 1y;
log_not_found off;
}

location ~ ^(/api|/fs|/icon|/carousel|/emails/unsubscribe) {
add_header 'Access-Control-Allow-Origin' "$http_origin";
add_header 'Access-Control-Allow-Credentials' 'true';
Expand Down Expand Up @@ -131,7 +137,7 @@ server {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;
fastcgi_buffers 64 32k;
fastcgi_buffers 64 32k;
fastcgi_buffer_size 64k;
include fastcgi_params;
Expand Down
32 changes: 27 additions & 5 deletions containers/nginx/minds.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ server {

index index.html;
server_name _;

error_log /dev/stdout warn;
access_log /dev/stdout main;

Expand Down Expand Up @@ -65,6 +65,12 @@ server {
etag off;
}

location /embed/ {
add_header 'Access-Control-Allow-Origin' *;
add_header X-Frame-Options "";
add_header X-Robots-Tag "noindex, nofollow, nosnippet, noarchive";
}

location / {
if ($is_cdn) {
return 301 https://www.minds.com$request_uri;
Expand Down Expand Up @@ -116,10 +122,10 @@ server {
add_header 'Access-Control-Allow-Credentials' 'true';
add_header 'Access-Control-Allow-Methods' 'GET, POST, PUT, DELETE, OPTIONS';
add_header 'Access-Control-Allow-Headers' 'Accept,Authorization,Cache-Control,Content-Type,DNT,If-Modified-Since,Keep-Alive,Origin,User-Agent,X-Mx-ReqToken,X-Requested-With,X-No-Cache,X-Robots-Tag';

rewrite ^(.+)$ /index.php last;
}

# Prod mode will proxy an s3 bucket
# Dev mode uses the dist/browser location (see dev-srr.conf.tpl)
location /static/ {
Expand All @@ -133,11 +139,27 @@ server {
proxy_intercept_errors on;
proxy_ssl_verify off;
proxy_ssl_server_name on;
#proxy_ssl off;
#proxy_ssl off;
proxy_pass https://cdn-assets.minds.com/front/dist/browser/;
proxy_redirect off;
}

location /embed-static/ {
expires 1y;
log_not_found off;

add_header 'Access-Control-Allow-Origin' *;

proxy_http_version 1.1;
proxy_set_header Host cdn-assets.minds.com;
proxy_intercept_errors on;
proxy_ssl_verify off;
proxy_ssl_server_name on;
#proxy_ssl off;
proxy_pass https://cdn-assets.minds.com/front/dist/embed/;
proxy_redirect off;
}

location /robots.txt {
rewrite ^(.+)$ /sitemaps/robots.txt last;
}
Expand Down Expand Up @@ -177,7 +199,7 @@ server {
fastcgi_pass php-fpm:9000;
fastcgi_index index.php;

fastcgi_buffers 64 32k;
fastcgi_buffers 64 32k;
fastcgi_buffer_size 64k;

fastcgi_max_temp_file_size 0;
Expand Down

0 comments on commit bd0e6b3

Please sign in to comment.