Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to deploy it ? #756

Open
JeazW opened this issue Nov 30, 2022 · 7 comments
Open

how to deploy it ? #756

JeazW opened this issue Nov 30, 2022 · 7 comments

Comments

@JeazW
Copy link

JeazW commented Nov 30, 2022

may i have a local one,thanks

@JeazW
Copy link
Author

JeazW commented Nov 30, 2022

i got it,now i am just handling the CORS problem

@inityun
Copy link

inityun commented Mar 6, 2023

i got it,now i am just handling the CORS problem

Did you succeed? if you are succeed. please tell me how it work? thanks

@JeazW
Copy link
Author

JeazW commented Mar 6, 2023

i got it,now i am just handling the CORS problem

Did you succeed? if you are succeed. please tell me how it work? thanks

git clone https://github.com/excalidraw/excalidraw.git
cd excalidraw/
yarn
yarn start

if you dont have yarn,run "npm install -g yarn" first

@inityun
Copy link

inityun commented Mar 6, 2023

git clone https://github.com/excalidraw/excalidraw.git
cd excalidraw/
yarn
yarn start

if you dont have yarn,run "npm install -g yarn" first

yes. install excalidraw is very easy.
in my server. I install excalidraw. i also down the excalidraw libraries project. copy to my nginx or apache root directory.it works.
But in my local excalidraw libraries website, click "Add To Excalidraw" button. Dont work.
Have you encountered this situation?
If I use my local excalidraw + official excalidraw libraries website, click "Add to excalidraw" button is work.

@JeazW
Copy link
Author

JeazW commented Mar 6, 2023

git clone https://github.com/excalidraw/excalidraw.git
cd excalidraw/
yarn
yarn start

if you dont have yarn,run "npm install -g yarn" first

yes. install excalidraw is very easy. in my server. I install excalidraw. i also down the excalidraw libraries project. copy to my nginx or apache root directory.it works. But in my local excalidraw libraries website, click "Add To Excalidraw" button. Dont work. Have you encountered this situation? If I use my local excalidraw + official excalidraw libraries website, click "Add to excalidraw" button is work.

that is just what i said "CORS" problem,you just need to add two lines in your nginx conf :
in the libraries's conf:

                 add_header Access-Control-Allow-Origin http://excalidraw.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

in the excalidraw's conf :

                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

here is my excalidraw.conf,mybe it's not perfect,but it does work:

server {
        listen 80;
        server_name excalidraw.mydomain.com
        location / {
                 proxy_http_version 1.1;
                 proxy_set_header Upgrade $http_upgrade;
                 proxy_set_header Connection "upgrade";
                 proxy_redirect off;
                 proxy_set_header       Host $host:$server_port;
                 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_pass http://127.0.0.1:3000;
                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;
        }

}

@inityun
Copy link

inityun commented Mar 6, 2023

git clone https://github.com/excalidraw/excalidraw.git
cd excalidraw/
yarn
yarn start

if you dont have yarn,run "npm install -g yarn" first

yes. install excalidraw is very easy. in my server. I install excalidraw. i also down the excalidraw libraries project. copy to my nginx or apache root directory.it works. But in my local excalidraw libraries website, click "Add To Excalidraw" button. Dont work. Have you encountered this situation? If I use my local excalidraw + official excalidraw libraries website, click "Add to excalidraw" button is work.

that is just what i said "CORS" problem,you just need to add two lines in your nginx conf : in the libraries's conf:

                 add_header Access-Control-Allow-Origin http://excalidraw.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

in the excalidraw's conf :

                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

here is my excalidraw.conf,mybe it's not perfect,but it does work:

server {
        listen 80;
        server_name excalidraw.,ydomain.com
        location / {
                 proxy_http_version 1.1;
                 proxy_set_header Upgrade $http_upgrade;
                 proxy_set_header Connection "upgrade";
                 proxy_redirect off;
                 proxy_set_header       Host $host:$server_port;
                 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_pass http://127.0.0.1:3000;
                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.ydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;
        }

}

thanks, I try it.

@inityun
Copy link

inityun commented Mar 7, 2023

git clone https://github.com/excalidraw/excalidraw.git
cd excalidraw/
yarn
yarn start

if you dont have yarn,run "npm install -g yarn" first

yes. install excalidraw is very easy. in my server. I install excalidraw. i also down the excalidraw libraries project. copy to my nginx or apache root directory.it works. But in my local excalidraw libraries website, click "Add To Excalidraw" button. Dont work. Have you encountered this situation? If I use my local excalidraw + official excalidraw libraries website, click "Add to excalidraw" button is work.

that is just what i said "CORS" problem,you just need to add two lines in your nginx conf : in the libraries's conf:

                 add_header Access-Control-Allow-Origin http://excalidraw.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

in the excalidraw's conf :

                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;

here is my excalidraw.conf,mybe it's not perfect,but it does work:

server {
        listen 80;
        server_name excalidraw.mydomain.com
        location / {
                 proxy_http_version 1.1;
                 proxy_set_header Upgrade $http_upgrade;
                 proxy_set_header Connection "upgrade";
                 proxy_redirect off;
                 proxy_set_header       Host $host:$server_port;
                 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_pass http://127.0.0.1:3000;
                 add_header Access-Control-Allow-Origin http://excalidraw-libraries.mydomain.com;
                 add_header Access-Control-Allow-Method POST,GET;
        }

}

thanks, the problem is "CORS", I edit nginx.conf, add some code. It works. thanks very much!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants