[GH-ISSUE #3060] [bug]: Not work auth on self-hosted #998

Closed
opened 2026-03-16 17:59:40 +03:00 by kerem · 14 comments
Owner

Originally created by @eljump on GitHub (May 16, 2023).
Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3060

Is there an existing issue for this?

  • I have searched the existing issues

Current behavior

Hi again, i repeat this issue, because it was closed, but not solved

https://github.com/hoppscotch/hoppscotch/issues/3016

I try to switch on release/2023.4.2 branch for testing,
Yes, there is no 404 screen any more, but the authorization still fails. It's just redirect on mainpage.
You can look result here:
http://hoppscotch-webest.ru:3000/

Steps to reproduce

Just follow docs

Environment

Production

Version

Self-hosted

Originally created by @eljump on GitHub (May 16, 2023). Original GitHub issue: https://github.com/hoppscotch/hoppscotch/issues/3060 ### Is there an existing issue for this? - [X] I have searched the existing issues ### Current behavior Hi again, i repeat this issue, because it was closed, but not solved https://github.com/hoppscotch/hoppscotch/issues/3016 I try to switch on release/2023.4.2 branch for testing, Yes, there is no 404 screen any more, but the authorization still fails. It's just redirect on mainpage. You can look result here: http://hoppscotch-webest.ru:3000/ ### Steps to reproduce Just follow docs ### Environment Production ### Version Self-hosted
kerem 2026-03-16 17:59:40 +03:00
Author
Owner

@kzachetovb2b commented on GitHub (May 17, 2023):

Have the same issue on selfhosted [2023.4.3]

<!-- gh-comment-id:1551271359 --> @kzachetovb2b commented on GitHub (May 17, 2023): Have the same issue on selfhosted [2023.4.3]
Author
Owner

@AndrewBastin commented on GitHub (May 17, 2023):

@kzachetovb2b @eljump can you guys provide server logs for the hoppscotch-backend service running on the background.

<!-- gh-comment-id:1551610027 --> @AndrewBastin commented on GitHub (May 17, 2023): @kzachetovb2b @eljump can you guys provide server logs for the `hoppscotch-backend` service running on the background.
Author
Owner

@eljump commented on GitHub (May 17, 2023):

@kzachetovb2b @eljump can you guys provide server logs for the hoppscotch-backend service running on the background.

How can i do it?

<!-- gh-comment-id:1551695321 --> @eljump commented on GitHub (May 17, 2023): > @kzachetovb2b @eljump can you guys provide server logs for the `hoppscotch-backend` service running on the background. How can i do it?
Author
Owner

@AndrewBastin commented on GitHub (May 17, 2023):

@eljump When you run the backend server (:3170 one), it will start outputting some text on your console, with the console open, try logging in and see if and send the logs up to that point. That way we can see if it is an actual issue.

<!-- gh-comment-id:1551714502 --> @AndrewBastin commented on GitHub (May 17, 2023): @eljump When you run the backend server (:3170 one), it will start outputting some text on your console, with the console open, try logging in and see if and send the logs up to that point. That way we can see if it is an actual issue.
Author
Owner

@kzachetovb2b commented on GitHub (May 17, 2023):

@AndrewBastin in my case logs are empty
in docker logs hoppscotch-backend i see only:

Query Complexity: 3
Query Complexity: 17
Query Complexity: 2
Query Complexity: 7
Query Complexity: 7
Query Complexity: 7
Query Complexity: 7
Query Complexity: 7
Query Complexity: 7

is there any way to run it in debug mode?

<!-- gh-comment-id:1551780727 --> @kzachetovb2b commented on GitHub (May 17, 2023): @AndrewBastin in my case logs are empty in `docker logs hoppscotch-backend` i see only: ``` Query Complexity: 3 Query Complexity: 17 Query Complexity: 2 Query Complexity: 7 Query Complexity: 7 Query Complexity: 7 Query Complexity: 7 Query Complexity: 7 Query Complexity: 7 ``` is there any way to run it in debug mode?
Author
Owner

@balub commented on GitHub (May 17, 2023):

@eljump just want to confirm was the migration run by prisma ?

<!-- gh-comment-id:1551803368 --> @balub commented on GitHub (May 17, 2023): @eljump just want to confirm was the migration run by prisma ?
Author
Owner

@balub commented on GitHub (May 17, 2023):

@eljump Your domain is currently http can you issue a TLS certificate and make it https, we use cookies for auth and they are secure cookies.

<!-- gh-comment-id:1551858204 --> @balub commented on GitHub (May 17, 2023): @eljump Your domain is currently http can you issue a TLS certificate and make it https, we use cookies for auth and they are secure cookies.
Author
Owner

@eljump commented on GitHub (May 18, 2023):

@balub
yes, migrations was run

i will try with TLS certificate and post the results here

@AndrewBastin
Okey, i will try

<!-- gh-comment-id:1552439452 --> @eljump commented on GitHub (May 18, 2023): @balub yes, migrations was run i will try with TLS certificate and post the results here @AndrewBastin Okey, i will try
Author
Owner

@eljump commented on GitHub (May 18, 2023):

@AndrewBastin

There is logs on start server
docker compose up hoppscotch-backend
[+] Running 3/3
✔ Network html_default            Created                                                                                                                                                            0.1s 
✔ Container html-hoppscotch-db-1  Created                                                                                                                                                            0.0s 
✔ Container hoppscotch-backend    Created                                                                                                                                                           16.6s 
Attaching to hoppscotch-backend
hoppscotch-backend  | 
hoppscotch-backend  | > hoppscotch-backend@2023.4.1 start:prod /usr/src/app
hoppscotch-backend  | > node dist/main
hoppscotch-backend  | 
hoppscotch-backend  | Running in production: true
hoppscotch-backend  | Port: 3000
hoppscotch-backend  | Database: postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [NestFactory] Starting Nest application...
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] PubSubModule dependencies initialized +96ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] PrismaModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] MailerModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] PassportModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] ThrottlerModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] JwtModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] MailerCoreModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] AppModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] MailerModule dependencies initialized +2ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserModule dependencies initialized +6ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserSettingsModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserEnvironmentsModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserHistoryModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserCollectionModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] TeamEnvironmentsModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] TeamCollectionModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] UserRequestModule dependencies initialized +11ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] TeamModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] ShortcodeModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] TeamInvitationModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] TeamRequestModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] AuthModule dependencies initialized +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] GraphQLModule dependencies initialized +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [InstanceLoader] AdminModule dependencies initialized +0ms
hoppscotch-backend  | Thu, 18 May 2023 05:44:40 GMT express-session deprecated undefined resave option; provide resave option at dist/main.js:15:13
hoppscotch-backend  | Thu, 18 May 2023 05:44:40 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at dist/main.js:15:13
hoppscotch-backend  | Enabling CORS with production settings
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RoutesResolver] AuthController {/auth} (version: 1): +11ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/signin, POST} (version: 1) route +4ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/verify, POST} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/refresh, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/google, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/google/callback, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/github, GET} (version: 1) route +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/github/callback, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/microsoft, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/microsoft/callback, GET} (version: 1) route +1ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/logout, GET} (version: 1) route +0ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [RouterExplorer] Mapped {/auth/verify/admin, GET} (version: 1) route +1ms
hoppscotch-backend  | Initialize PubSub
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [GraphQLModule] Mapped {/graphql, POST} route +487ms
hoppscotch-backend  | [Nest] 19  - 05/18/2023, 5:44:40 AM     LOG [NestApplication] Nest application successfully started +4ms
While logging in to the client through a browser and trying to authorize, I only get responses like this
hoppscotch-backend  | Query Complexity: 3
hoppscotch-backend  | Query Complexity: 4
hoppscotch-backend  | Query Complexity: 7
hoppscotch-backend  | Query Complexity: 3
hoppscotch-backend  | Query Complexity: 17
hoppscotch-backend  | Query Complexity: 2
hoppscotch-backend  | Query Complexity: 7
hoppscotch-backend  | Query Complexity: 3
hoppscotch-backend  | Query Complexity: 4
hoppscotch-backend  | Query Complexity: 3
hoppscotch-backend  | Query Complexity: 17
hoppscotch-backend  | Query Complexity: 2
<!-- gh-comment-id:1552467496 --> @eljump commented on GitHub (May 18, 2023): @AndrewBastin <details> <summary>There is logs on start server</summary> ``` docker compose up hoppscotch-backend [+] Running 3/3 ✔ Network html_default Created 0.1s ✔ Container html-hoppscotch-db-1 Created 0.0s ✔ Container hoppscotch-backend Created 16.6s Attaching to hoppscotch-backend hoppscotch-backend | hoppscotch-backend | > hoppscotch-backend@2023.4.1 start:prod /usr/src/app hoppscotch-backend | > node dist/main hoppscotch-backend | hoppscotch-backend | Running in production: true hoppscotch-backend | Port: 3000 hoppscotch-backend | Database: postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch?connect_timeout=300 hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [NestFactory] Starting Nest application... hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] PubSubModule dependencies initialized +96ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] PrismaModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] MailerModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] PassportModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] ThrottlerModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] JwtModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] MailerCoreModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] AppModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] MailerModule dependencies initialized +2ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserModule dependencies initialized +6ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserSettingsModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserEnvironmentsModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserHistoryModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserCollectionModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] TeamEnvironmentsModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] TeamCollectionModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] GraphQLSchemaBuilderModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] UserRequestModule dependencies initialized +11ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] TeamModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] ShortcodeModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] TeamInvitationModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] TeamRequestModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] AuthModule dependencies initialized +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] GraphQLModule dependencies initialized +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [InstanceLoader] AdminModule dependencies initialized +0ms hoppscotch-backend | Thu, 18 May 2023 05:44:40 GMT express-session deprecated undefined resave option; provide resave option at dist/main.js:15:13 hoppscotch-backend | Thu, 18 May 2023 05:44:40 GMT express-session deprecated undefined saveUninitialized option; provide saveUninitialized option at dist/main.js:15:13 hoppscotch-backend | Enabling CORS with production settings hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RoutesResolver] AuthController {/auth} (version: 1): +11ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/signin, POST} (version: 1) route +4ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/verify, POST} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/refresh, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/google, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/google/callback, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/github, GET} (version: 1) route +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/github/callback, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/microsoft, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/microsoft/callback, GET} (version: 1) route +1ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/logout, GET} (version: 1) route +0ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [RouterExplorer] Mapped {/auth/verify/admin, GET} (version: 1) route +1ms hoppscotch-backend | Initialize PubSub hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [GraphQLModule] Mapped {/graphql, POST} route +487ms hoppscotch-backend | [Nest] 19 - 05/18/2023, 5:44:40 AM LOG [NestApplication] Nest application successfully started +4ms ``` </details> <details> <summary>While logging in to the client through a browser and trying to authorize, I only get responses like this</summary> ``` hoppscotch-backend | Query Complexity: 3 hoppscotch-backend | Query Complexity: 4 hoppscotch-backend | Query Complexity: 7 hoppscotch-backend | Query Complexity: 3 hoppscotch-backend | Query Complexity: 17 hoppscotch-backend | Query Complexity: 2 hoppscotch-backend | Query Complexity: 7 hoppscotch-backend | Query Complexity: 3 hoppscotch-backend | Query Complexity: 4 hoppscotch-backend | Query Complexity: 3 hoppscotch-backend | Query Complexity: 17 hoppscotch-backend | Query Complexity: 2 ``` </details>
Author
Owner

@eljump commented on GitHub (May 23, 2023):

@balub
Thank you for the advice. We have added an SSL certificate, and the authorization is now working.

We are using Nginx. We have set up proxying as follows: the main domain on port 3000, port 3100 to 3101, and port 3170 to 3171. Consequently, we also updated the port information in the .env file and rebuilt the application. Instead of ports, subdomains could have been used.

@liyasthomas
It might be worth mentioning in the documentation that authorization only works with HTTPS.

Thanks a lot for every one

P. s.: i wait this update on main branch)))

<!-- gh-comment-id:1559344658 --> @eljump commented on GitHub (May 23, 2023): @balub Thank you for the advice. We have added an SSL certificate, and the authorization is now working. We are using Nginx. We have set up proxying as follows: the main domain on port 3000, port 3100 to 3101, and port 3170 to 3171. Consequently, we also updated the port information in the .env file and rebuilt the application. Instead of ports, subdomains could have been used. @liyasthomas It might be worth mentioning in the documentation that authorization only works with HTTPS. Thanks a lot for every one P. s.: i wait this update on main branch)))
Author
Owner

@kzachetovb2b commented on GitHub (Jun 9, 2023):

@eljump Hello! Could you please share with your configuration of nginx and .env file that works for you?
i am not experienced in nginx configuration and my config is not working , i got "network error" while sending magic link, it can not get correct response from https://hoppscotch.mydomain:3171/v1/auth/signin
{"statusCode":404,"message":"Cannot GET /v1/auth/signin","error":"Not Found"}

my nginx conf is :

server {
    listen 443 ssl;
    server_name hoppscotch.mydomain;
    ssl_certificate /etc/nginx/certs/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/privkey.pem;
    location / {
        proxy_pass http://localhost:3000;
    }
}
server {
    listen 3101 ssl;
    server_name hoppscotch.mydomain;
    ssl_certificate /etc/nginx/certs/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/privkey.pem;
    location / {
        proxy_pass http://localhost:3100;
    }
}
server {
    listen 3171 ssl;
    server_name hoppscotch.mydomain;
    ssl_certificate /etc/nginx/certs/fullchain.pem;
    ssl_certificate_key /etc/nginx/certs/privkey.pem;
    location / {
        proxy_pass http://localhost:3170;
    }
}

env:

#-----------------------Backend Config------------------------------#
# Prisma Config
DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch

# Auth Tokens Config
JWT_SECRET="secret"
TOKEN_SALT_COMPLEXITY=10
MAGIC_LINK_TOKEN_VALIDITY= 3
REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days (604800000 ms) in ms
ACCESS_TOKEN_VALIDITY="86400000" # Default validity is 1 day (86400000 ms) in ms
SESSION_SECRET='secret'

# Hoppscotch App Domain Config
REDIRECT_URL="https://hoppscotch.mydomain:443"
WHITELISTED_ORIGINS = "https://hoppscotch.mydomain:3171,https://hoppscotch.mydomain:443,https://hoppscotch.mydomain:3101"

# Google Auth Config
GOOGLE_CLIENT_ID="************************************************"
GOOGLE_CLIENT_SECRET="************************************************"
GOOGLE_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/google/callback"
GOOGLE_SCOPE="email,profile"

# Github Auth Config
GITHUB_CLIENT_ID="************************************************"
GITHUB_CLIENT_SECRET="************************************************"
GITHUB_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/github/callback"
GITHUB_SCOPE="user:email"

# Microsoft Auth Config
MICROSOFT_CLIENT_ID="************************************************"
MICROSOFT_CLIENT_SECRET="************************************************"
MICROSOFT_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/microsoft/callback"
MICROSOFT_SCOPE="user.read"

# Mailer config
MAILER_SMTP_URL="smtps://smtpserveraddress"
MAILER_ADDRESS_FROM='user@mydomain'

# Rate Limit Config
RATE_LIMIT_TTL=60 # In seconds
RATE_LIMIT_MAX=100 # Max requests per IP


#-----------------------Frontend Config------------------------------#


# Base URLs
VITE_BASE_URL=https://hoppscotch.mydomain:443
VITE_SHORTCODE_BASE_URL=https://hoppscotch.mydomain:443
VITE_ADMIN_URL=https://hoppscotch.mydomain:3101

# Backend URLs
VITE_BACKEND_GQL_URL=https://hoppscotch.mydomain:3171/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch.mydomain:3171/graphql
VITE_BACKEND_API_URL=https://hoppscotch.mydomain:3171/v1

# Terms Of Service And Privacy Policy Links (Optional)
VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms
VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy
<!-- gh-comment-id:1584695853 --> @kzachetovb2b commented on GitHub (Jun 9, 2023): @eljump Hello! Could you please share with your configuration of nginx and .env file that works for you? i am not experienced in nginx configuration and my config is not working , i got "network error" while sending magic link, it can not get correct response from https://hoppscotch._mydomain_:3171/v1/auth/signin {"statusCode":404,"message":"Cannot GET /v1/auth/signin","error":"Not Found"} my nginx conf is : ``` server { listen 443 ssl; server_name hoppscotch.mydomain; ssl_certificate /etc/nginx/certs/fullchain.pem; ssl_certificate_key /etc/nginx/certs/privkey.pem; location / { proxy_pass http://localhost:3000; } } server { listen 3101 ssl; server_name hoppscotch.mydomain; ssl_certificate /etc/nginx/certs/fullchain.pem; ssl_certificate_key /etc/nginx/certs/privkey.pem; location / { proxy_pass http://localhost:3100; } } server { listen 3171 ssl; server_name hoppscotch.mydomain; ssl_certificate /etc/nginx/certs/fullchain.pem; ssl_certificate_key /etc/nginx/certs/privkey.pem; location / { proxy_pass http://localhost:3170; } } ``` env: ``` #-----------------------Backend Config------------------------------# # Prisma Config DATABASE_URL=postgresql://postgres:testpass@hoppscotch-db:5432/hoppscotch # Auth Tokens Config JWT_SECRET="secret" TOKEN_SALT_COMPLEXITY=10 MAGIC_LINK_TOKEN_VALIDITY= 3 REFRESH_TOKEN_VALIDITY="604800000" # Default validity is 7 days (604800000 ms) in ms ACCESS_TOKEN_VALIDITY="86400000" # Default validity is 1 day (86400000 ms) in ms SESSION_SECRET='secret' # Hoppscotch App Domain Config REDIRECT_URL="https://hoppscotch.mydomain:443" WHITELISTED_ORIGINS = "https://hoppscotch.mydomain:3171,https://hoppscotch.mydomain:443,https://hoppscotch.mydomain:3101" # Google Auth Config GOOGLE_CLIENT_ID="************************************************" GOOGLE_CLIENT_SECRET="************************************************" GOOGLE_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/google/callback" GOOGLE_SCOPE="email,profile" # Github Auth Config GITHUB_CLIENT_ID="************************************************" GITHUB_CLIENT_SECRET="************************************************" GITHUB_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/github/callback" GITHUB_SCOPE="user:email" # Microsoft Auth Config MICROSOFT_CLIENT_ID="************************************************" MICROSOFT_CLIENT_SECRET="************************************************" MICROSOFT_CALLBACK_URL="https://hoppscotch.mydomain:3171/v1/auth/microsoft/callback" MICROSOFT_SCOPE="user.read" # Mailer config MAILER_SMTP_URL="smtps://smtpserveraddress" MAILER_ADDRESS_FROM='user@mydomain' # Rate Limit Config RATE_LIMIT_TTL=60 # In seconds RATE_LIMIT_MAX=100 # Max requests per IP #-----------------------Frontend Config------------------------------# # Base URLs VITE_BASE_URL=https://hoppscotch.mydomain:443 VITE_SHORTCODE_BASE_URL=https://hoppscotch.mydomain:443 VITE_ADMIN_URL=https://hoppscotch.mydomain:3101 # Backend URLs VITE_BACKEND_GQL_URL=https://hoppscotch.mydomain:3171/graphql VITE_BACKEND_WS_URL=wss://hoppscotch.mydomain:3171/graphql VITE_BACKEND_API_URL=https://hoppscotch.mydomain:3171/v1 # Terms Of Service And Privacy Policy Links (Optional) VITE_APP_TOS_LINK=https://docs.hoppscotch.io/support/terms VITE_APP_PRIVACY_POLICY_LINK=https://docs.hoppscotch.io/support/privacy ```
Author
Owner

@eljump commented on GitHub (Jun 14, 2023):

@kzachetovb2b
Hi, we do the proxies in nginx, and auth from other ports, this work for us, look:
We do three confs for diffrent ports:
image

hopp.conf:

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}


server {
  listen 80;
  server_name hoppscotch-webest.ru;
  return 301 https://$host$request_uri;
}


server {
  listen 443 ssl http2;
  server_name hoppscotch-webest.ru ;
    ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot


  location ^~ /.well-known/acme-challenge/ {
    default_type "text/plain";
    root /var/www/letsencrypt;
  }

        client_max_body_size 1G;
        fastcgi_buffers 64 4K;


  location / {
    #proxy_read_timeout 600s;
    #proxy_connect_timeout 600s;
      proxy_pass http://127.0.0.1:3000;
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
  }


}

hopp3100.conf

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}



server {
  listen 3101 ssl http2;
  server_name hoppscotch-webest.ru;
    ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



  location / {
    #proxy_read_timeout 600s;
    #proxy_connect_timeout 600s;
      proxy_pass http://127.0.0.1:3100;
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
  }


}

hopp3170.conf

map $http_upgrade $connection_upgrade {
    default upgrade;
    '' close;
}



server {
  listen 3171 ssl http2;
  server_name hoppscotch-webest.ru;
    ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot
    ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot
    include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
    ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot



  location / {
    #proxy_read_timeout 600s;
    #proxy_connect_timeout 600s;
      proxy_pass http://127.0.0.1:3170;
      proxy_set_header Host $host;
      proxy_http_version 1.1;
      proxy_set_header Upgrade $http_upgrade;
      proxy_set_header Connection $connection_upgrade;
  }


}

so in .env we use domain, and domain with ports 3101, 3171
smth like this

REDIRECT_URL="https://hoppscotch-webest.ru"
WHITELISTED_ORIGINS="https://hoppscotch-webest.ru:3171,https://hoppscotch-webest.ru,https://hoppscotch-webest.ru:3101"
GITHUB_CALLBACK_URL="https://hoppscotch-webest.ru:3171/v1/auth/github/callback"
GITHUB_SCOPE="user:email"
VITE_BASE_URL=https://hoppscotch-webest.ru
VITE_SHORTCODE_BASE_URL=https://hoppscotch-webest.ru
VITE_ADMIN_URL=https://hoppscotch-webest.ru:3101

# Backend URLs
VITE_BACKEND_GQL_URL=https://hoppscotch-webest.ru:3171/graphql
VITE_BACKEND_WS_URL=wss://hoppscotch-webest.ru:3171/graphql
VITE_BACKEND_API_URL=https://hoppscotch-webest.ru:3171/v1

Of couse, instead of ports, you can use subdomains

<!-- gh-comment-id:1590939903 --> @eljump commented on GitHub (Jun 14, 2023): @kzachetovb2b Hi, we do the proxies in nginx, and auth from other ports, this work for us, look: We do three confs for diffrent ports: ![image](https://github.com/hoppscotch/hoppscotch/assets/45133615/5f7b3dee-8fe9-42a6-befc-ea617c24261d) hopp.conf: ``` map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 80; server_name hoppscotch-webest.ru; return 301 https://$host$request_uri; } server { listen 443 ssl http2; server_name hoppscotch-webest.ru ; ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location ^~ /.well-known/acme-challenge/ { default_type "text/plain"; root /var/www/letsencrypt; } client_max_body_size 1G; fastcgi_buffers 64 4K; location / { #proxy_read_timeout 600s; #proxy_connect_timeout 600s; proxy_pass http://127.0.0.1:3000; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } ``` hopp3100.conf ``` map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 3101 ssl http2; server_name hoppscotch-webest.ru; ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { #proxy_read_timeout 600s; #proxy_connect_timeout 600s; proxy_pass http://127.0.0.1:3100; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } ``` hopp3170.conf ``` map $http_upgrade $connection_upgrade { default upgrade; '' close; } server { listen 3171 ssl http2; server_name hoppscotch-webest.ru; ssl_certificate /etc/letsencrypt/live/hoppscotch-webest.ru/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/hoppscotch-webest.ru/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot location / { #proxy_read_timeout 600s; #proxy_connect_timeout 600s; proxy_pass http://127.0.0.1:3170; proxy_set_header Host $host; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection $connection_upgrade; } } ``` so in .env we use domain, and domain with ports 3101, 3171 smth like this ``` REDIRECT_URL="https://hoppscotch-webest.ru" WHITELISTED_ORIGINS="https://hoppscotch-webest.ru:3171,https://hoppscotch-webest.ru,https://hoppscotch-webest.ru:3101" ``` ``` GITHUB_CALLBACK_URL="https://hoppscotch-webest.ru:3171/v1/auth/github/callback" GITHUB_SCOPE="user:email" ``` ``` VITE_BASE_URL=https://hoppscotch-webest.ru VITE_SHORTCODE_BASE_URL=https://hoppscotch-webest.ru VITE_ADMIN_URL=https://hoppscotch-webest.ru:3101 # Backend URLs VITE_BACKEND_GQL_URL=https://hoppscotch-webest.ru:3171/graphql VITE_BACKEND_WS_URL=wss://hoppscotch-webest.ru:3171/graphql VITE_BACKEND_API_URL=https://hoppscotch-webest.ru:3171/v1 ``` Of couse, instead of ports, you can use subdomains
Author
Owner

@kzachetovb2b commented on GitHub (Jun 16, 2023):

@eljump Thanks a lot, mate! Really appreciate your help! it works for me as well

<!-- gh-comment-id:1594227896 --> @kzachetovb2b commented on GitHub (Jun 16, 2023): @eljump Thanks a lot, mate! Really appreciate your help! it works for me as well
Author
Owner

@dreamwhite commented on GitHub (Jul 21, 2023):

Does this work also when using docker-compose.yml bundled with the repo?

<!-- gh-comment-id:1645223337 --> @dreamwhite commented on GitHub (Jul 21, 2023): Does this work also when using `docker-compose.yml` bundled with the repo?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#998
No description provided.