Skip to content

Remove sock files on nginx startup #2131

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

Merged
merged 13 commits into from
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Move the status socks to /var/lib
  • Loading branch information
ciarams87 committed Jun 21, 2024
commit d7a32596e8f87bcb8b5dd3c089826fdcaae7ad10
2 changes: 1 addition & 1 deletion build/Dockerfile.nginx
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ LABEL org.nginx.ngf.image.build.agent="${BUILD_AGENT}"

USER 101:1001

CMD ["sh", "-c", "rm -rf /var/run/nginx/* /var/lib/nginx/*.sock && /docker-entrypoint.sh nginx -g 'daemon off;'"]
CMD ["sh", "-c", "rm -rf /var/lib/nginx/*.sock && /docker-entrypoint.sh nginx -g 'daemon off;'"]
2 changes: 1 addition & 1 deletion build/Dockerfile.nginxplus
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,4 @@ USER 101:1001

LABEL org.nginx.ngf.image.build.agent="${BUILD_AGENT}"

CMD ["sh", "-c", "rm -rf /var/run/nginx/* /var/lib/nginx/*.sock && nginx -g 'daemon off;'"]
CMD ["sh", "-c", "rm -rf /var/lib/nginx/*.sock && nginx -g 'daemon off;'"]
2 changes: 1 addition & 1 deletion internal/mode/static/metrics/collectors/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
)

const (
nginxStatusSock = "/var/run/nginx/nginx-status.sock"
nginxStatusSock = "/var/lib/nginx/nginx-status.sock"
nginxStatusURI = "http://config-status/stub_status"
)

Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/conf/nginx-plus.conf
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ http {
}

server {
listen unix:/var/run/nginx/nginx-plus-api.sock;
listen unix:/var/lib/nginx/nginx-plus-api.sock;
access_log off;

location /api {
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/conf/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ http {
tcp_nopush on;

server {
listen unix:/var/run/nginx/nginx-status.sock;
listen unix:/var/lib/nginx/nginx-status.sock;
access_log off;

location /stub_status {
Expand Down
2 changes: 1 addition & 1 deletion internal/mode/static/nginx/runtime/clients.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
)

const (
nginxPlusAPISock = "/var/run/nginx/nginx-plus-api.sock"
nginxPlusAPISock = "/var/lib/nginx/nginx-plus-api.sock"
nginxPlusAPIURI = "http://nginx-plus-api/api"
)

Expand Down