I am new to config volto, and I do follow this link
But I am not success, anyone can point to to a working nginx config file. So I can learn how to setup it?
Thanks
I am new to config volto, and I do follow this link
But I am not success, anyone can point to to a working nginx config file. So I can learn how to setup it?
Thanks
See the nginx configuration used in the nginx, Frontend, Backend container example
for a start.
upstream backend {
server backend:8080;
}
upstream frontend {
server frontend:3000;
}
server {
listen 80 default_server;
server_name plone.localhost;
location ~ /\+\+api\+\+($|/.*) {
rewrite ^/(\+\+api\+\+\/?)+($|/.*) /VirtualHostBase/http/$server_name/Plone/++api++/VirtualHostRoot/$2 break;
proxy_pass http://backend;
}
location ~ / {
location ~* \.(js|jsx|css|less|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
expires +1y;
proxy_pass http://frontend;
}
location ~* static.*\.(ico|jpg|jpeg|png|gif|svg)$ {
add_header Cache-Control "public";
expires +1y;
proxy_pass http://frontend;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect http:// https://;
proxy_pass http://frontend;
}
}
``
Thanks
I do follow this, but because I am not with docker I changed server backend:8080 to localhost:8080 and frontend:3000 to localhost:3000
And they when I load with the browser the site is broken.
upstream backend {
server backend:8080;
}
upstream frontend {
server frontend:3000;
}
server {
listen 80 default_server;
server_name plone.localhost;
location ~ /\+\+api\+\+($|/.*) {
rewrite ^/(\+\+api\+\+\/?)+($|/.*) /VirtualHostBase/http/$server_name/Plone/++api++/VirtualHostRoot/$2 break;
proxy_pass http://backend;
}
location ~ / {
location ~* \.(js|jsx|css|less|swf|eot|ttf|otf|woff|woff2)$ {
add_header Cache-Control "public";
expires +1y;
proxy_pass http://frontend;
}
location ~* static.*\.(ico|jpg|jpeg|png|gif|svg)$ {
add_header Cache-Control "public";
expires +1y;
proxy_pass http://frontend;
}
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_redirect http:// https://;
proxy_pass http://frontend;
}
}