Skip to content
Snippets Groups Projects
Commit 229867c3 authored by Etienne LOUPIAS's avatar Etienne LOUPIAS
Browse files

test

parent 608be020
No related branches found
No related tags found
1 merge request!942render page for linkedin
...@@ -38,18 +38,21 @@ server { ...@@ -38,18 +38,21 @@ server {
#allow 80.14.51.82; # Erasme #allow 80.14.51.82; # Erasme
#deny all; #deny all;
# prerender news post for linkedin # Prerender news post for linkedin
location ~ ^/actualites/details/(.*)$ { # use regular expression for location to avoid nginx resolve error (https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve ) #
location ^~ /actualites/details/ {
resolver dns-default.openshift-dns.svc.cluster.local; resolver dns-default.openshift-dns.svc.cluster.local;
# proxy_set_header must be outside if clause (cf. https://stackoverflow.com/questions/16500594/why-i-cant-put-proxy-set-header-inside-an-if-clause )
proxy_set_header User-Agent "";
if ($prerender = 1) { if ($prerender = 1) {
# For use of proxy_pass within a regular expression location, cf. https://stackoverflow.com/a/53354944 # For use of proxy_pass within a regular expression location, cf. https://stackoverflow.com/a/53354944
proxy_pass http://res-client-service.ns-res-d01-syn.svc.cluster.local:8080/api/render/$uri;
# tester :
#proxy_pass http://res-client-service.cluster.local:8080/api/render/$1;
proxy_pass http://res-client-service.ns-res-d01-syn.svc.cluster.local:8080/api/render/$1;
} }
# if no prerender, apply default angular route
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
......
...@@ -24,13 +24,19 @@ server { ...@@ -24,13 +24,19 @@ server {
root /usr/share/nginx/html/; root /usr/share/nginx/html/;
# prerender news post for linkedin # Prerender news post for linkedin
location ~ ^/actualites/details/(.*)$ { # use regular expression for location to avoid nginx resolve error (https://stackoverflow.com/questions/57937222/502-bad-gateway-nginx-no-resolver-defined-to-resolve ) #
location ^~ /actualites/details/ {
# proxy_set_header must be outside if clause (cf. https://stackoverflow.com/questions/16500594/why-i-cant-put-proxy-set-header-inside-an-if-clause )
proxy_set_header User-Agent "";
if ($prerender = 1) { if ($prerender = 1) {
# For use of proxy_pass within a regular expression location, cf. https://stackoverflow.com/a/53354944 # For use of proxy_pass within a regular expression location, cf. https://stackoverflow.com/a/53354944
proxy_pass http://172.17.0.1:8030/api/render/$1; proxy_pass http://172.17.0.1:8030/api/render/$uri;
} }
# if no prerender, apply default angular route
try_files $uri $uri/ /index.html; try_files $uri $uri/ /index.html;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment