Noobie question here.
I've setted up Parse-Server in my Ubuntu droplet and i'm currently dealing with an issue here. My ssl is from letsencrypt
In this file
/etc/nginx/sites-enabled/default
I have the following
# HTTP - redirect all requests to HTTPS server { listen 80; listen [::]:80 default_server ipv6only=on; server_name example.com; return 301 https://$host$request_uri; } # HTTPS - serve HTML from /usr/share/nginx/html, proxy requests to /parse/ # through to Parse Server server { listen 443; server_name example.com; root /usr/share/nginx/html; index index.html index.htm; ssl on; # Use certificate and key provided by Let's Encrypt: ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; ssl_session_timeout 5m; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_prefer_server_ciphers on; ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; # Pass requests for /parse/ to Parse Server instance at localhost:1337 location /parse/ { 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_pass http://localhost:1337/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; } location /test/ { 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_pass http://localhost:1337/test/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; } location /dashboard/ { 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_pass http://localhost:4040/dashboard/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; } location / { try_files $uri $uri/ =404; } }
So the followin links are working fine
but they are working cause of the default file has the code to work fine. I can't do that for all the directories that parse has for example
is getting a 404 error.
Is there any way to make all the pages available without having to configure them in the default
file?
Update
So when I put this inside my default file
location /parse/ { 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_pass http://localhost:1337/parse/; proxy_ssl_session_reuse off; proxy_set_header Host $http_host; proxy_redirect off; }
I get no 404 error. This is because of the proxy_pass http://localhost:1337/parse/
that is different from the first file that I've posted here.
But how can i do that for ALL the requests no matter /parse/
or /something/
etc? I cannot right down here ALL the folders and possible links that i will create inside server. Because at this domain I will also setup a website which will have /assets/
etc and it will need each single one. Isn't there any code to include ALL the possible links that it will be created?
assets