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

Wrong url / missing port in storage/app urls #49

Open
marcoboehrs opened this issue Jul 16, 2021 · 0 comments
Open

Wrong url / missing port in storage/app urls #49

marcoboehrs opened this issue Jul 16, 2021 · 0 comments

Comments

@marcoboehrs
Copy link

marcoboehrs commented Jul 16, 2021

OC runs on Port 80 behind a reverse proxy (nginx container) with ssl termination which runs on port 8443.
I can get all content with https://:8443 but not the images stored in /var/www/html/storage/app/...

In all URLs, except for the storage urls, the port 8443 is present. See attached screenshot from the chrome web developer tools showing the urls.

125451981-4b8dacc8-524b-40ca-859e-5d3c64898d64

my oc docker-compose.yml:

version: "3.8"
services:
	web:
		image: "aspendigital/octobercms:php7.4-apache"
		container_name: "octobercms"
		environment:
			  - DB_TYPE=mysql
			  - DB_HOST=mariadb
			  - DB_DATABASE=octobercms
			  - DB_USERNAME=octobercms
			  - DB_PASSWORD=octobercms
			  - CMS_LINK_POLICY=secure
			  - VIRTUAL_HOST=<external ip nginx proxy>
			  - VIRTUAL_PROTO=http
			  - VIRTUAL_PORT=8443                        
		networks:
			  - "dmz"
		volumes:
			  - /srv/octobercms/plugins:/var/www/html/plugins
			  - /srv/octobercms/storage/app:/var/www/html/storage/app
			  - /srv/octobercms/storage/logs:/var/www/html/storage/logs
			  - /srv/octobercms/themes:/var/www/html/themes


	mariadb:
		image: "mariadb:10.6.2"
		container_name: "database"
		restart: always
		environment:
			  MYSQL_RANDOM_ROOT_PASSWORD: 1
			  MYSQL_DATABASE: octobercms
			  MYSQL_USER: octobercms
			  MYSQL_PASSWORD: octobercms
		volumes:
			  - /srv/octobercms/mysql/data:/var/lib/mysql
		networks:
			  - "dmz"

networks:
		  dmz:
			  external: true

my nginx docker-compose.yml:

version: "3.8"
  
services:
    reverse-proxy:
		  build: .
		  container_name: "reverse-proxy"
		  restart: "always"
		  networks:
			  - "dmz"
		  ports:
			  - "8443:8443"
  
networks:
	dmz:
		  external: true

nginx.conf server block:

server {
	listen 			8443 ssl;
	server_name 	<external ip>;

	ssl_certificate 		/etc/ssl/certificate.pem;
	ssl_certificate_key 	/etc/ssl/certificate.key;

	location / {
		proxy_pass 				"http://octobercms:80";
		proxy_set_header Host 	$host;
		proxy_cache 			off;
	}
}
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

1 participant