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 not to access directly with the root domain name #25

Open
JadeVane opened this issue Apr 1, 2020 · 2 comments
Open

How not to access directly with the root domain name #25

JadeVane opened this issue Apr 1, 2020 · 2 comments

Comments

@JadeVane
Copy link

JadeVane commented Apr 1, 2020

How not to access directly with the root domain name?What I want just like this:

sn.doamin.com = the web version of standard notes
sn.domain.com/api = the login api for standardfile

I want to use sn.doamin.com for the web version of standard notes, not for the dashboard of standardfile.

@tectiv3
Copy link
Owner

tectiv3 commented Apr 2, 2020

Hi, here is an example for caddy from my server

example.com {
    log /var/log/caddy.log
    root /var/www/html
    gzip

    proxy /api localhost:8888 {
        transparent
    }

    cors / {
        origin            *
        methods           GET,POST,PUT,PATCH,DELETE,OPTIONS
        allow_credentials true
        exposed_headers   Access-Token,Client,UID
        allowed_headers   Authorization,Content-Type
    }

}

That way standardfile will only answer on /api routes

@JadeVane
Copy link
Author

JadeVane commented Apr 2, 2020

@tectiv3 I am very grateful for this, but I mainly use nginx now, I apologize for not making it clear in the issue sincerely.

I am not familiar with caddy. Could you help me write a configuration file for nginx?

And thank you for making this project. It help me a lot.

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