-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
console: add ConfigMap for nginx configurations
mco-console uses nginx for serving the UI assests. Add its configuration from the operator instead of build time. Signed-off-by: SanjalKatiyar <sanjaldhir@gmail.com>
- Loading branch information
1 parent
72dfdab
commit 18c22eb
Showing
3 changed files
with
96 additions
and
2 deletions.
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 |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
Copyright 2021 Red Hat OpenShift Data Foundation. | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
*/ | ||
|
||
package console | ||
|
||
// Update it with correct configuration | ||
var NginxConf = ` | ||
# Do not comment/un-comment without any reference. | ||
worker_processes auto; | ||
error_log /var/log/nginx/error.log; | ||
pid /run/nginx.pid; | ||
# Load dynamic modules. See /usr/share/doc/nginx/README.dynamic. | ||
include /usr/share/nginx/modules/*.conf; | ||
events { | ||
worker_connections 1024; | ||
} | ||
http { | ||
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; | ||
sendfile on; | ||
tcp_nopush on; | ||
tcp_nodelay on; | ||
keepalive_timeout 65; | ||
types_hash_max_size 4096; | ||
include /etc/nginx/mime.types; | ||
default_type application/octet-stream; | ||
# Load modular configuration files from the /etc/nginx/conf.d directory. | ||
# See http://nginx.org/en/docs/ngx_core_module.html#include | ||
# for more information. | ||
include /opt/app-root/etc/nginx.d/*.conf; | ||
server { | ||
listen 9001 ssl; | ||
listen [::]:9001 ssl; | ||
ssl_certificate /var/serving-cert/tls.crt; | ||
ssl_certificate_key /var/serving-cert/tls.key; | ||
location / { | ||
root /opt/app-root/src; | ||
} | ||
location /compatibility/ { | ||
root /opt/app-root/src; | ||
} | ||
error_page 500 502 503 504 /50x.html; | ||
location = /50x.html { | ||
root /usr/share/nginx/html; | ||
} | ||
ssi on; | ||
add_header Last-Modified $date_gmt; | ||
add_header Cache-Control 'no-store, no-cache, must-revalidate, proxy-revalidate, max-age=0'; | ||
if_modified_since off; | ||
expires off; | ||
etag off; | ||
} | ||
} | ||
` |