Maybe this post would help you achieving what you have in mind. Check the 
first part of it 
out https://groups.google.com/g/dspace-tech/c/UwMvhb6QWnk/m/02Ot51vwAQAJ

On Thursday, November 17, 2022 at 1:43:00 PM UTC+3 [email protected] 
wrote:

> Hi,
> I'm currently trying to make a demo with a public domain and to do this I 
> must use an Nginx located in a different server where I have DSpace.
>
> Frontend loads fine and backend works too, but I unable to make the 
> frontend work with the backend (CORS Error).
>
> I've tried all combinations possible but nothing works. Here I attach the 
> actual configuration, I don't see what I'm doing wrong!
>
> *NGINX*
> upstream node_upstream {
>     server 192.168.10.43:4000;
>     keepalive 64;
> }
>
> server {
>     listen 80;
>
>     server_name *demo.example.com <http://demo.example.com/>;*
>
>     location / {
>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>         proxy_set_header X-Real-IP $remote_addr;
>         proxy_set_header Host $http_host;
>
>         proxy_http_version 1.1;
>         proxy_set_header Upgrade $http_upgrade;
>         proxy_set_header Connection "upgrade";
>
>         proxy_pass http://node_upstream/;
>         proxy_redirect off;
>         proxy_read_timeout 240s;
>     }
> }
>
> upstream back_upstream {
>     server 192.168.10.43:8080;
>     keepalive 64;
> }
>
> server {
>     listen 80;
>
>     server_name demo-api.example.com;
>
>     location / {
>         proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
>         proxy_set_header X-Real-IP $remote_addr;
>         proxy_set_header Host $http_host;
>
>         proxy_http_version 1.1;
>         proxy_set_header Upgrade $http_upgrade;
>         proxy_set_header Connection "upgrade";
>
>         proxy_pass http://back_upstream/;
>         proxy_redirect off;
>         proxy_read_timeout 240s;
>     }
> }
>
>
> *dspace local.cfg *
>
> dspace.server.url = http://demo-api.example.com/server
> dspace.ui.url = http://demo.example.com
>
> rest.cors.allowed-origins = ${dspace.ui.url},http://demo.example.com,
> http://192.168.10.43:4000,http://192.168.10.10
> (192.168.10.10 is the server with Nginx)
>
> *config.yml (frontend)*
> ui:
>   ssl: false
>   host: 192.168.10.43
>   port: 4000
>   nameSpace: /
> rest:
>   ssl: false
>   host: demo-api.e <http://demo-api.abev.net/>xample.com
>   port: 80
>   nameSpace: /server
>

-- 
All messages to this mailing list should adhere to the Code of Conduct: 
https://www.lyrasis.org/about/Pages/Code-of-Conduct.aspx
--- 
You received this message because you are subscribed to the Google Groups 
"DSpace Technical Support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/dspace-tech/85a74d30-7d08-4e7a-b4df-f5b8e4b5e8e3n%40googlegroups.com.

Reply via email to