Quantcast
Channel: Active questions tagged svelte - Stack Overflow
Viewing all articles
Browse latest Browse all 1541

Problem with Nginx proxy redirection to Svelte application hosted in Droplet together with Ghost CMS Local

$
0
0

I want to deploy a sveltekit app to an ubuntu virtual server (v 22.04.3 lts) with local Ghost CMS also runing locally, and using a nginx server proxy to redirect the main '/' to the application and '/blog' to Ghost.

So far the virtual server comes with Ghost CMS already installed and i´ve already configured it, it runs automatically and I´ve set the url to the ipaddress/blog and it works great. However when I set the proxy redirection to the localhost of the sveltekit application it doesn´t work.

Here is the nginx site configuration for the svelte app:

upstream sveltekit-server {  server localhost:port;  keepalive 8;}server {  listen 80;  server_name server_ip;  root /var/www/svelte_app/build/client;  location / {    try_files $uri $uri/ @sveltekit;  }  location @sveltekit {    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-NginX-Proxy true;    proxy_set_header X-Forwarded-Proto $scheme;    proxy_set_header X-Sendfile-Type X-Accel-Redirect;    proxy_pass http://sveltekit-server;    proxy_redirect off;    # error_page 502 = @static;  }  location ^~ /_app/immutable/ {    # gzip_static on;    expires max;    add_header Cache-Control public;    access_log off;    try_files $uri $uri/;  }}

here is the ghost cms site conf:

    listen 80;    listen [::]:80;    server_name server_ip;    root /var/www/ghost/system/nginx-root; # Used for acme.sh SSL verification     location /blog {        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;        proxy_set_header X-Forwarded-Proto $scheme;        proxy_set_header X-Real-IP $remote_addr;        proxy_set_header Host $http_host;        proxy_pass http://127.0.0.1:2368;    }    location ~ /.well-known {        allow all;    }    client_max_body_size 50m;}```I´ve tried changind localhost ports, changing to multiple nginx site configuration taken from various sites on the problem, so far nothing has worked. Perhaps it is the nginx configuration or I´ve to reinstall nginx.If someone identifies the problem it will be appreciated.

Viewing all articles
Browse latest Browse all 1541

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>