78 404 when the application put under nginx subdirectory with proxy pass (#79)

* use http.FileServer insetead of custom middleware

* fixed behavior under reverse proxy

* enabled reverse proxy subfolder as "domain value"

* domain validation

* code refactoring

* code refactoring

* updated translation
This commit is contained in:
Marco
2023-08-21 12:24:50 +02:00
committed by GitHub
parent a005f159c6
commit c50c1f627e
8 changed files with 55 additions and 29 deletions

View File

@@ -1,5 +1,6 @@
import {
Button,
Checkbox,
Container,
FormControl,
FormControlLabel,
@@ -36,6 +37,7 @@ import {
languages,
latestCliArgumentsState,
pathOverridingState,
servedFromReverseProxyState,
serverAddressState,
serverPortState,
themeState
@@ -48,6 +50,7 @@ import { validateDomain, validateIP } from '../utils'
// NEED ABSOLUTELY TO BE SPLIT IN MULTIPLE COMPONENTS
export default function Settings() {
const [reverseProxy, setReverseProxy] = useRecoilState(servedFromReverseProxyState)
const [formatSelection, setFormatSelection] = useRecoilState(formatSelectionState)
const [pathOverriding, setPathOverriding] = useRecoilState(pathOverridingState)
const [fileRenaming, setFileRenaming] = useRecoilState(fileRenamingState)
@@ -154,16 +157,27 @@ export default function Settings() {
InputProps={{
startAdornment: <InputAdornment position="start">ws://</InputAdornment>,
}}
sx={{ mb: 2 }}
/>
</Grid>
<Grid item xs={12} md={1}>
<TextField
disabled={reverseProxy}
fullWidth
label={i18n.t('serverPortTitle')}
defaultValue={serverPort}
onChange={(e) => serverPort$.next(e.currentTarget.value)}
error={isNaN(Number(serverPort)) || Number(serverPort) > 65535}
/>
</Grid>
<Grid item xs={12}>
<FormControlLabel
control={
<Checkbox
defaultChecked={reverseProxy}
onChange={() => setReverseProxy(state => !state)}
/>
}
label={i18n.t('servedFromReverseProxyCheckbox')}
sx={{ mb: 2 }}
/>
</Grid>