Skip to content

Commit

Permalink
fix(caddy): match host without port
Browse files Browse the repository at this point in the history
  • Loading branch information
gempain committed Dec 10, 2020
1 parent eb00f57 commit eeeaefe
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# urls
MELI_URL=http://localhost:3001
MELI_URL=http://localhost:8080
MELI_URL_INTERNAL=http://host.docker.internal:3001
MELI_UI_URL=http://localhost:3000
MELI_UI_URL_INTERNAL=http://host.docker.internal:3000
Expand All @@ -14,4 +14,4 @@ MELI_SITES_DIR=./data/sites
MELI_USER=user
MELI_PASSWORD=password

DEBUG=meli.api:handleError,meli.api:caddy
DEBUG=meli.api:handleError,meli*
3 changes: 1 addition & 2 deletions docker-compose-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ services:
image: caddy
command: [ 'caddy', 'run', '--config', '/etc/caddy/config.json', '--resume' ]
ports:
- 127.0.0.1:80:80
- 127.0.0.1:443:443
- 127.0.0.1:8080:80
- 127.0.0.1:2019:2019
volumes:
- ./data/sites:/sites
Expand Down
2 changes: 1 addition & 1 deletion src/caddy/config/api-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const melihost = new URL(env.MELI_URL);
export const apiRoute = {
group: 'api',
match: [{
host: [melihost.host],
host: [melihost.hostname],
path: [
'/api/*',
'/auth/*',
Expand Down
2 changes: 1 addition & 1 deletion src/caddy/config/generate-site-routes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function generateSiteRoutes(site: Site): any[] {
const domains: SiteDomain[] = [
...(site.domains || []),
{
name: `${site.name}.${sitesUrl.host}`,
name: `${site.name}.${sitesUrl.hostname}`,
sslConfiguration: {
type: 'acme',
} as AcmeSslConfiguration,
Expand Down
2 changes: 1 addition & 1 deletion src/caddy/config/ui-route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ const meliuihost = new URL(env.MELI_UI_URL);
export const uiRoute = {
group: 'ui',
match: [{
host: [meliuihost.host],
host: [meliuihost.hostname],
path: ['/*'],
}],
handle: [
Expand Down

0 comments on commit eeeaefe

Please sign in to comment.