Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix Windows reload issue (/bin/sh not found)#1389

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

@Alireza-Gholiei
Copy link
Contributor

This PR adds native Windows compatibility for Nginx-UI, fixing the following error when reloading Nginx on
Windows:

Nginx error: exec: "/bin/sh": executable file not found in %PATH%

Updated execShell in internal/nginx/exec.go
to use cmd /C instead of /bin/sh -c when running on Windows.

This makes ReloadCmd, RestartCmd, and other Nginx commands work properly on Windows environments.

Implementation Detail

funcexecShell(cmdstring) (stdOutstring,stdErrerror) {ifruntime.GOOS=="windows" {returnexecCommand("cmd","/C",cmd)    }returnexecCommand("/bin/sh","-c",cmd)}

Added import "runtime" for OS detection.

Tested Environment

OS: Windows 10 / Windows Server 2019

Nginx: Windows build (nginx.exe)

Result:

Reload and Restart work correctly

UI responds successfully

No /bin/sh errors

@0xJacky
Copy link
Owner

LGTM 🎉

Alireza-Gholiei reacted with laugh emoji

@0xJacky0xJacky merged commit9eb759d into0xJacky:devOct 12, 2025
24 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@Alireza-Gholiei@0xJacky

[8]ページ先頭

©2009-2025 Movatter.jp