Skip to content
New issue

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

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

Already on GitHub? # to your account

Apache2 / ISPConfig Proxy w. GitLab 502 Error #314

Open
yupthatguy opened this issue Jul 3, 2021 · 0 comments
Open

Apache2 / ISPConfig Proxy w. GitLab 502 Error #314

yupthatguy opened this issue Jul 3, 2021 · 0 comments

Comments

@yupthatguy
Copy link

My server is running an ISPConfig control panel on port 8080, so I am trying to configure a proxy for Gitlab on port 9000, however, I am getting a 502 error. There is likely an obvious mistake that I am missing.

`System information
System:		Debian 10
Current User:	git
Using RVM:	no
Ruby Version:	2.7.2p137
Gem Version:	3.1.4
Bundler Version:2.1.4
Rake Version:	13.0.3
Redis Version:	6.0.12
Git Version:	2.31.1
Sidekiq Version:5.2.9
Go Version:	go1.11.6 linux/amd64

GitLab information
Version:	13.12.4
Revision:	02b97bd2a77
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	PostgreSQL
DB Version:	12.6
URL:		http://dev.example.com
HTTP Clone URL:	http://dev.example.com/some-group/some-project.git
SSH Clone URL:	git@dev.example.com:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	13.18.0
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
GitLab Shell path:		/opt/gitlab/embedded/service/gitlab-shell
Git:		/opt/gitlab/embedded/bin/git

My /etc/gitlab/gitlab.rb contains:

web_server['external_users'] = ['www-data']
web_server['username'] = 'apache'
web_server['group'] = 'apache'
nginx['enable'] = false
external_url 'http://dev.example.com'
gitlab_rails['trusted_proxies'] = ['192.168.0.10']
gitlab_workhorse['listen_network'] = "tcp"
gitlab_workhorse['listen_addr'] = "127.0.0.1:9000" 

And, my /etc/apache2/sites-enabled/100-dev.example.com.vhost contains:

<Directory /var/www/dev.example.com>
		AllowOverride None
				Require all denied
		</Directory>

<VirtualHost *:80>


									DocumentRoot /var/www/dev.example.com/web
						
		ServerName dev.example.com
		ServerAdmin webmaster@dev.example.com


		ErrorLog /var/log/ispconfig/httpd/dev.example.com/error.log

		Alias /error/ "/var/www/dev.example.com/web/error/"
		ErrorDocument 400 /error/400.html
		ErrorDocument 401 /error/401.html
		ErrorDocument 403 /error/403.html
		ErrorDocument 404 /error/404.html
		ErrorDocument 405 /error/405.html
		ErrorDocument 500 /error/500.html
		ErrorDocument 502 /error/502.html
		ErrorDocument 503 /error/503.html


		<Directory /var/www/dev.example.com/web>
				# Clear PHP settings of this website
				<FilesMatch ".+\.ph(p[345]?|t|tml)$">
						SetHandler None
				</FilesMatch>
				Options +SymlinksIfOwnerMatch
				AllowOverride All
								Require all granted
								<Files ~ '.php[s3-6]{0,1}$'>
												Require all denied
										</Files>
		</Directory>
		<Directory /var/www/clients/client0/web8/web>
				# Clear PHP settings of this website
				<FilesMatch ".+\.ph(p[345]?|t|tml)$">
						SetHandler None
				</FilesMatch>
				Options +SymlinksIfOwnerMatch
				AllowOverride All
								Require all granted
								<Files ~ '.php[s3-6]{0,1}$'>
										Require all denied
									</Files>
		</Directory>


		# add support for apache mpm_itk
		<IfModule mpm_itk_module>
			AssignUserId web8 client0
		</IfModule>

		<IfModule mod_dav_fs.c>
		# Do not execute PHP files in webdav directory
			<Directory /var/www/clients/client0/web8/webdav>
				<ifModule mod_security2.c>
					SecRuleRemoveById 960015
					SecRuleRemoveById 960032
				</ifModule>
				<FilesMatch "\.ph(p3?|tml)$">
					SetHandler None
				</FilesMatch>
			</Directory>
			DavLockDB /var/www/clients/client0/web8/tmp/DavLock
			# DO NOT REMOVE THE COMMENTS!
			# IF YOU REMOVE THEM, WEBDAV WILL NOT WORK ANYMORE!
      # WEBDAV BEGIN
			# WEBDAV END
		</IfModule>

			
ServerName dev.example.com
  ServerAdmin admin@dev.example.com
    ServerSignature Off

    ProxyPreserveHost On
  
  <Proxy *>
     Require all granted
  </Proxy>
  
  ProxyPass / http://127.0.0.1:9000/
  ProxyPassReverse / http://dev.example.com/
  
   AllowEncodedSlashes NoDecode
 
 
  <Location />

    Require all granted


  </Location>
  
  
  RewriteEngine on
			
  RewriteCond %{DOCUMENT_ROOT}/%{REQUEST_FILENAME} !-f [OR]
  RewriteCond %{REQUEST_URI} ^/uploads/.*
  RewriteRule .* http://127.0.0.1:9000%{REQUEST_URI} [P,QSA,NE]

	

</VirtualHost>

Any tips on what I am missing?

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

1 participant