Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
ssl-reverse-proxy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pipelines
images
test
ssl-reverse-proxy
Commits
f133ab52
Commit
f133ab52
authored
4 months ago
by
ale
Browse files
Options
Downloads
Patches
Plain Diff
Use a prefix for env vars
parent
385d40a2
No related branches found
No related tags found
No related merge requests found
Pipeline
#85444
passed
4 months ago
Stage: build
Changes
2
Pipelines
1
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
README.md
+3
-3
3 additions, 3 deletions
README.md
start.sh
+5
-5
5 additions, 5 deletions
start.sh
with
8 additions
and
8 deletions
README.md
+
3
−
3
View file @
f133ab52
...
@@ -5,7 +5,7 @@ proxy one domain to a single upstream address.
...
@@ -5,7 +5,7 @@ proxy one domain to a single upstream address.
Use environment variables to control the proxy behavior.
Use environment variables to control the proxy behavior.
*
`PORT`
(default 443) - Port that the proxy will listen on.
*
`
PROXY_
PORT`
(default 443) - Port that the proxy will listen on.
*
`DOMAIN`
- Domain to proxy.
*
`
PROXY_
DOMAIN`
- Domain to proxy.
*
`BACKEND_ADDR`
- Address (in host:port syntax) of the upstream.
*
`
PROXY_
BACKEND_ADDR`
- Address (in host:port syntax) of the upstream.
This diff is collapsed.
Click to expand it.
start.sh
+
5
−
5
View file @
f133ab52
...
@@ -8,8 +8,8 @@ config_dir=$(mktemp -d)
...
@@ -8,8 +8,8 @@ config_dir=$(mktemp -d)
echo
"generating self-signed certificate..."
echo
"generating self-signed certificate..."
openssl req
-x509
-newkey
rsa:2048
-sha256
-days
3650
\
openssl req
-x509
-newkey
rsa:2048
-sha256
-days
3650
\
-nodes
-keyout
${
config_dir
}
/ssl.key
-out
${
config_dir
}
/ssl.crt
\
-nodes
-keyout
${
config_dir
}
/ssl.key
-out
${
config_dir
}
/ssl.crt
\
-subj
"/CN=
${
DOMAIN
}
"
\
-subj
"/CN=
${
PROXY_
DOMAIN
}
"
\
-addext
"subjectAltName=DNS:
${
DOMAIN
}
,DNS:*.
${
DOMAIN
}
"
-addext
"subjectAltName=DNS:
${
PROXY_
DOMAIN
}
,DNS:*.
${
PROXY_
DOMAIN
}
"
cat
>
${
config_dir
}
/nginx.conf
<<
EOF
cat
>
${
config_dir
}
/nginx.conf
<<
EOF
include /etc/nginx/modules-enabled/*.conf;
include /etc/nginx/modules-enabled/*.conf;
...
@@ -30,12 +30,12 @@ http {
...
@@ -30,12 +30,12 @@ http {
include /etc/nginx/conf.d/*.conf;
include /etc/nginx/conf.d/*.conf;
upstream target {
upstream target {
server
${
BACKEND_ADDR
}
;
server
${
PROXY_
BACKEND_ADDR
}
;
}
}
server {
server {
listen [::]:
${
PORT
:-
443
}
http2 ssl;
listen [::]:
${
PROXY_
PORT
:-
443
}
http2 ssl;
server_name *.
${
DOMAIN
}
${
DOMAIN
}
;
server_name *.
${
PROXY_
DOMAIN
}
${
PROXY_
DOMAIN
}
;
ssl_certificate
${
config_dir
}
/ssl.crt;
ssl_certificate
${
config_dir
}
/ssl.crt;
ssl_certificate_key
${
config_dir
}
/ssl.key;
ssl_certificate_key
${
config_dir
}
/ssl.key;
location / {
location / {
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment