From bd961f4b4b7a18afde30509942b4e12d0123bcd3 Mon Sep 17 00:00:00 2001 From: orhtej2 <2871798+orhtej2@users.noreply.github.com> Date: Wed, 7 Feb 2024 22:21:43 +0100 Subject: [PATCH] Use full domain. --- conf/environ | 2 +- conf/exporter.service | 3 +-- conf/nginx.conf | 22 +++++++++++----------- manifest.toml | 4 ---- 4 files changed, 13 insertions(+), 18 deletions(-) diff --git a/conf/environ b/conf/environ index 6e7458b..041527b 100644 --- a/conf/environ +++ b/conf/environ @@ -22,6 +22,6 @@ export PENPOT_SMTP_TLS=true export PENPOT_ASSETS_STORAGE_BACKEND=assets-fs export PENPOT_STORAGE_ASSETS_FS_DIRECTORY=__DATA_DIR__/assets export PENPOT_SECRET_KEY=__SECRET_KEY__ -export PENPOT_PUBLIC_URI=https://__DOMAIN____PATH__ +export PENPOT_PUBLIC_URI=https://__DOMAIN__ export PENPOT_REDIS_URI=redis://127.0.0.1:6379:__REDIS_DB__ export PENPOT_TELEMETRY_ENABLED=false \ No newline at end of file diff --git a/conf/exporter.service b/conf/exporter.service index 3882c8c..1cab20f 100644 --- a/conf/exporter.service +++ b/conf/exporter.service @@ -9,12 +9,11 @@ User=__APP__ Group=__APP__ WorkingDirectory=__INSTALL_DIR__/exporter -WorkingDirectory=__INSTALL_DIR__/ ExecStart=__YNH_NODE__ app.js --http-server-port=__PORT__ Restart=always Environment=__YNH_NODE_LOAD_PATH__ Environment=NODE_ENV=production -Environment=PENPOT_PUBLIC_URI=https://__DOMAIN____PATH__ +Environment=PENPOT_PUBLIC_URI=https://__DOMAIN__ Environment=PENPOT_REDIS_URI=redis://127.0.0.1:6379:__REDIS_DB__ StandardOutput=append:/var/log/__APP__/__APP__-exporter.log StandardError=inherit diff --git a/conf/nginx.conf b/conf/nginx.conf index 790addc..c80b578 100644 --- a/conf/nginx.conf +++ b/conf/nginx.conf @@ -1,12 +1,12 @@ -#sub_path_only rewrite ^__PATH__$ __PATH__/ permanent; -location __PATH__/assets { +#sub_path_only rewrite ^$ / permanent; +location /assets { proxy_pass http://127.0.0.1:__PORT__/assets; recursive_error_pages on; proxy_intercept_errors on; error_page 301 302 307 = @handle_redirect; } -location __PATH__/internal/gfonts/css { +location /internal/gfonts/css { proxy_pass https://fonts.googleapis.com/css?$args; proxy_hide_header Access-Control-Allow-Origin; proxy_hide_header Cross-Origin-Resource-Policy; @@ -26,27 +26,27 @@ location __PATH__/internal/gfonts/css { add_header X-Cache-Status $upstream_cache_status; } -location __PATH__/internal/assets { +location /internal/assets { internal; alias __DATA_DIR__/assets; add_header x-internal-redirect "$upstream_http_x_accel_redirect"; } -location __PATH__/api/export { +location /api/export { proxy_pass http://127.0.0.1:__PORT_EXPORTER__; } -location __PATH__/api { +location /api { proxy_pass http://127.0.0.1:__PORT__/api; } -location __PATH__/ws/notifications { +location /ws/notifications { proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_pass http://127.0.0.1:__PORT__/ws/notifications; } -location __PATH__/ { +location / { location ~ ^/internal/gfonts/font/(?.+) { proxy_pass https://fonts.gstatic.com/s/$font_file; @@ -65,7 +65,7 @@ location __PATH__/ { proxy_set_header Host "fonts.gstatic.com"; proxy_set_header Accept "*/*"; - proxy_cache penpot; + # proxy_cache penpot; add_header Access-Control-Allow-Origin $http_origin; add_header Cache-Control max-age=86400; @@ -84,9 +84,9 @@ location __PATH__/ { } location ~ ^/[^/]+/(.*)$ { - return 301 " __PATH__/404"; + return 301 " /404"; } - root __INSTALL_DIR/frontend/; + root __INSTALL_DIR__/frontend/; try_files $uri /index.html$is_args$args =404; } \ No newline at end of file diff --git a/manifest.toml b/manifest.toml index 5ff6d64..f4a8022 100644 --- a/manifest.toml +++ b/manifest.toml @@ -33,10 +33,6 @@ ram.runtime = "50M" [install.domain] type = "domain" - [install.path] - type = "path" - default = "/penpot" - [install.init_main_permission] type = "group" default = "visitors"