perftools / xhgui

Web interface for XHProf profiling data can store data in MongoDB or PDO database
1.65k stars 341 forks source link

Put the nginx conf to the correct place #482

Closed batuhannarci closed 2 years ago

batuhannarci commented 2 years ago

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

glensc commented 2 years ago

I guess the change came with updating base image?

batuhannarci commented 2 years ago

I guess the change came with updating base image?

I'll try it again and let you know.

glensc commented 2 years ago

I'll try it again and let you know.

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

batuhannarci commented 2 years ago

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 commented 2 years ago

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

batuhannarci commented 2 years ago

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

I got it now, my bad 😊

glensc commented 2 years ago

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 commented 2 years ago

so, the PR is valid. merging.

    # Includes virtual hosts configs.
-   include /etc/nginx/conf.d/*.conf;
+   include /etc/nginx/http.d/*.conf;
jayceyzh commented 2 years ago

Thanks,now is ok!

glensc commented 2 years ago

How to solve this question?

solve what question? huh

glensc commented 2 years ago

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

GitHub is wrong:

image