Skip to content
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

Put the nginx conf to the correct place #482

Merged
merged 1 commit into from
Jul 24, 2022

Conversation

batuhannarci
Copy link
Contributor

When using Docker installation method, Nginx reads the http.d instead of conf.d.

When using Docker installation method, Nginx reads the http.d instead of conf.d.
@glensc glensc changed the base branch from 0.22.x to 0.21.x July 22, 2022 12:15
@glensc
Copy link
Contributor

glensc commented Jul 22, 2022

I guess the change came with updating base image?

@batuhannarci
Copy link
Contributor Author

I guess the change came with updating base image?

I'll try it again and let you know.

@glensc
Copy link
Contributor

glensc commented Jul 23, 2022

I'll try it again and let you know.

I don't understand, what will you be doing?

@batuhannarci
Copy link
Contributor Author

I'll try it again and let you know.

I don't understand, what will you be doing?

I thought that you said that update your base image. So, I wrote that I'll try to update and try again.

If I understand wrongly, sorry about that.

@glensc
Copy link
Contributor

glensc commented Jul 23, 2022

I sad the change is needed likely because the base image was updated.

@batuhannarci
Copy link
Contributor Author

I sad the change is needed likely because the base image was updated.

I got it now, my bad 😊

@glensc
Copy link
Contributor

glensc commented Jul 24, 2022

Extracted /etc/nginx:

docker run --name v0.20 xhgui/xhgui:0.20 echo
docker cp v0.20:/etc/nginx v0.20
docker run --name v0.21 xhgui/xhgui:0.21 echo
docker cp v0.21:/etc/nginx v0.21

changes:

diff -ur v0.20 v0.21 > changes.diff
Only in v0.20: conf.d
Only in v0.21: http.d
diff -ur v0.20/nginx.conf v0.21/nginx.conf
--- v0.20/nginx.conf	2021-06-02 13:55:50.000000000 +0300
+++ v0.21/nginx.conf	2022-04-28 20:34:16.000000000 +0300
@@ -14,6 +14,9 @@
 # Includes files with directives to load dynamic modules.
 include /etc/nginx/modules/*.conf;
 
+# Uncomment to include files with config snippets into the root context.
+# NOTE: This will be enabled by default in Alpine 3.15.
+#include /etc/nginx/conf.d/*.conf;
 
 events {
 	# The maximum number of simultaneous connections that can be opened by
@@ -29,52 +32,62 @@
 
 	# Name servers used to resolve names of upstream servers into addresses.
 	# It's also needed when using tcpsocket and udpsocket in Lua modules.
-	#resolver 208.67.222.222 208.67.220.220;
+	#resolver 1.1.1.1 1.0.0.1 2606:4700:4700::1111 2606:4700:4700::1001;
 
-	# Don't tell nginx version to clients.
+	# Don't tell nginx version to the clients. Default is 'on'.
 	server_tokens off;
 
 	# Specifies the maximum accepted body size of a client request, as
 	# indicated by the request header Content-Length. If the stated content
 	# length is greater than this size, then the client receives the HTTP
-	# error code 413. Set to 0 to disable.
+	# error code 413. Set to 0 to disable. Default is '1m'.
 	client_max_body_size 1m;
 
-	# Timeout for keep-alive connections. Server will close connections after
-	# this time.
-	keepalive_timeout 65;
-
 	# Sendfile copies data between one FD and other from within the kernel,
-	# which is more efficient than read() + write().
+	# which is more efficient than read() + write(). Default is off.
 	sendfile on;
 
-	# Don't buffer data-sends (disable Nagle algorithm).
-	# Good for sending frequent small bursts of data in real time.
-	tcp_nodelay on;
-
 	# Causes nginx to attempt to send its HTTP response head in one packet,
-	# instead of using partial frames.
-	#tcp_nopush on;
+	# instead of using partial frames. Default is 'off'.
+	tcp_nopush on;
 
 
+	# Enables the specified protocols. Default is TLSv1 TLSv1.1 TLSv1.2.
+	# TIP: If you're not obligated to support ancient clients, remove TLSv1.1.
+	ssl_protocols TLSv1.1 TLSv1.2 TLSv1.3;
+
 	# Path of the file with Diffie-Hellman parameters for EDH ciphers.
+	# TIP: Generate with: `openssl dhparam -out /etc/ssl/nginx/dh2048.pem 2048`
 	#ssl_dhparam /etc/ssl/nginx/dh2048.pem;
 
 	# Specifies that our cipher suits should be preferred over client ciphers.
+	# Default is 'off'.
 	ssl_prefer_server_ciphers on;
 
 	# Enables a shared SSL cache with size that can hold around 8000 sessions.
+	# Default is 'none'.
 	ssl_session_cache shared:SSL:2m;
 
+	# Specifies a time during which a client may reuse the session parameters.
+	# Default is '5m'.
+	ssl_session_timeout 1h;
+
+	# Disable TLS session tickets (they are insecure). Default is 'on'.
+	ssl_session_tickets off;
+
 
 	# Enable gzipping of responses.
 	#gzip on;
 
-	# Set the Vary HTTP header as defined in the RFC 2616.
+	# Set the Vary HTTP header as defined in the RFC 2616. Default is 'off'.
 	gzip_vary on;
 
-	# Enable checking the existence of precompressed files.
-	#gzip_static on;
+
+	# Helper variable for proxying websockets.
+	map $http_upgrade $connection_upgrade {
+		default upgrade;
+		'' close;
+	}
 
 
 	# Specifies the main log format.
@@ -87,5 +100,8 @@
 
 
 	# Includes virtual hosts configs.
-	include /etc/nginx/conf.d/*.conf;
+	include /etc/nginx/http.d/*.conf;
 }
+
+# TIP: Uncomment if you use stream module.
+#include /etc/nginx/stream.conf;

@glensc
Copy link
Contributor

glensc commented Jul 24, 2022

so, the PR is valid. merging.

 	# Includes virtual hosts configs.
-	include /etc/nginx/conf.d/*.conf;
+	include /etc/nginx/http.d/*.conf;

@glensc glensc merged commit 5b71f20 into perftools:0.21.x Jul 24, 2022
@glensc glensc added this to the 0.21.1 milestone Jul 24, 2022
@jayceyzh
Copy link

Thanks,now is ok!

@glensc
Copy link
Contributor

glensc commented Jul 25, 2022

How to solve this question?

solve what question? huh

@glensc
Copy link
Contributor

glensc commented Jul 25, 2022

Released as https://github.com/perftools/xhgui/releases/tag/0.21.1

GitHub is wrong:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants