Skip to content

Instantly share code, notes, and snippets.

@snaga
Created April 17, 2022 02:17
Show Gist options
  • Save snaga/93fc99097b439aee05eb503a218f450c to your computer and use it in GitHub Desktop.
Save snaga/93fc99097b439aee05eb503a218f450c to your computer and use it in GitHub Desktop.
nginx.conf.diff
*** nginx.conf.orig 2022-04-17 01:50:37.192213186 +0000
--- nginx.conf 2022-04-17 02:14:05.153078648 +0000
***************
*** 36,43 ****
include /etc/nginx/conf.d/*.conf;
server {
! listen 80;
! listen [::]:80;
server_name _;
root /usr/share/nginx/html;
--- 36,43 ----
include /etc/nginx/conf.d/*.conf;
server {
! listen 8080;
! listen [::]:8080;
server_name _;
root /usr/share/nginx/html;
***************
*** 53,58 ****
--- 53,76 ----
}
}
+ server {
+ listen 80;
+ listen [::]:80;
+ server_name _;
+
+ # Load configuration files for the default server block.
+ include /etc/nginx/default.d/*.conf;
+
+ location = / {
+ proxy_pass http://127.0.0.1:8080;
+
+ auth_basic "auth test";
+ auth_basic_user_file /etc/nginx/.htpasswd;
+
+ add_header Set-Cookie remote_user=$remote_user;
+ }
+ }
+
# Settings for a TLS enabled server.
#
# server {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment