-
Notifications
You must be signed in to change notification settings - Fork 2
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
Feature/deseng536 Redirect landuseplanning.gov.bc.ca to planninginpartnership.ca #113
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
18e29ce
DESENG-536 Add nginx redirect
e394fb6
Merge branch 'dev' into feature/deseng536
158376b
DESENG-536 Remove linting from bulid so it completes
03fe724
DESENG-536 correct invalid version number
bd1c3a4
DESENG-536 Move RP config from default to conf template
Baelx 8131e82
DESENG-536 Update nginx config
Baelx 3c4f602
DESENG-536 Add server config for each possible domain
Baelx 6d3a2f6
DESENG-536 Add default server block as a catch all
Baelx 200d12f
DESENG-536 Remove extraneous domains and keep default
Baelx 5be99e3
DESENG-536 Use configmaps instead of app-level nginx config
Baelx 32ef109
DESENG-536 Update changelog
Baelx 2ea84fd
DESENG-536 add more detail to nginx conf comment
Baelx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
# This config file's functionality has been reassigned to per-environment ConfigMaps in the dev, test, and prod projects in OpenShift | ||
# It is maintained here for transparency only | ||
|
||
worker_processes auto; | ||
|
||
error_log /var/log/nginx/error.log; | ||
|
@@ -13,34 +16,15 @@ http { | |
default_type application/octet-stream; | ||
server_tokens off; | ||
|
||
# ip filtering | ||
#%IpFilterRules% | ||
|
||
# geo $loggable { | ||
# default 1; | ||
# %RealIpFrom% 0; | ||
# } | ||
|
||
# Use a w3c standard log format | ||
log_format main '$remote_addr - $remote_user [$time_local] "$request" ' | ||
'$status $body_bytes_sent "$http_referer" ' | ||
'"$http_user_agent" "$http_x_forwarded_for"'; | ||
access_log /var/log/nginx/access.log main; | ||
# access_log /var/log/nginx/access.log main if=$loggable; | ||
|
||
sendfile on; | ||
#tcp_nopush on; | ||
|
||
keepalive_timeout 65; | ||
|
||
#gzip on; | ||
|
||
#real_ip module | ||
# set_real_ip_from %RealIpFrom%; | ||
#%AdditionalRealIpFromRules% | ||
# real_ip_recursive on; | ||
# real_ip_header X-Forwarded-For; | ||
|
||
#throttle zones | ||
limit_req_zone $binary_remote_addr zone=bra1:10m rate=1r/s; | ||
limit_req_zone $binary_remote_addr zone=bra3:10m rate=3r/s; | ||
|
@@ -54,8 +38,9 @@ http { | |
client_max_body_size 100m; | ||
|
||
server { | ||
listen 8080 default_server; | ||
server_name localhost; | ||
listen 8080; | ||
server_name landuseplanning.gov.bc.ca; | ||
rewrite ^/(.*)$ https://planninginpartnership.ca/$1 permanent; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like a standard permanent redirect 👍 |
||
|
||
# add in most common security headers | ||
add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'"; | ||
|
@@ -99,15 +84,61 @@ http { | |
# Only allow access from localhost | ||
allow all; | ||
|
||
# Other request should be denied | ||
# deny all; | ||
|
||
# No need to log this request, its just noise | ||
access_log off; | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
server { | ||
listen 8080 default_server; | ||
server_name localhost; | ||
|
||
# add in most common security headers | ||
add_header Content-Security-Policy "default-src * data: blob: filesystem: 'unsafe-inline' 'unsafe-eval'"; | ||
add_header Strict-Transport-Security "max-age=86400; includeSubDomains"; | ||
add_header X-Content-Type-Options "nosniff"; | ||
add_header X-XSS-Protection 1; | ||
add_header X-Frame-Options DENY; | ||
add_header X-UA-Compatible "IE=Edge,chrome=1"; | ||
|
||
# serve our angular app here | ||
location / { | ||
# important - the root folder must be where your index.htm file is. | ||
root /tmp/app/dist; | ||
index index.html index.htm; | ||
try_files $uri $uri/ /index.html; | ||
gzip on; | ||
gzip_min_length 1000; | ||
gzip_types *; | ||
|
||
sendfile off; | ||
expires -1; | ||
|
||
# propagate SMGOV_* headers | ||
add_header SMGOV_USERGUID $http_smgov_userguid; | ||
add_header SMGOV_USERDISPLAYNAME $http_smgov_userdisplayname; | ||
add_header SMGOV_USERTYPE $http_smgov_usertype; | ||
add_header SMGOV_USERIDENTIFIER $http_smgov_useridentifier; | ||
} | ||
|
||
# redirect server error pages to the static page /50x.html | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
|
||
# For status of ngnix service, OpenShift is configured to call this | ||
location /nginx_status { | ||
# Enable Nginx stats | ||
stub_status on; | ||
|
||
# Only allow access from localhost | ||
allow all; | ||
|
||
# No need to log this request, its just noise | ||
access_log off; | ||
} | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this cleanup!