Skip to content

Hosting in a sub-directory? #449

Answered by murty2
murty2 asked this question in Q&A
Jun 20, 2024 · 3 comments · 3 replies
Discussion options

You must be logged in to vote

Here's the full working solution. It's server-side but it works. Suppose you want to serve daedalOS as example.com/webtop

After you run "yarn build" it will generate "out" directory.

  • Copy out directory: cp -a out /var/www/html/webtop
  • Run the following
find /var/www/html/webtop -type f -exec chmod 644 {} \;
find /var/www/html/webtop -type d -exec chmod 755 {} \;
  • Replace no-referrer by same-origin to make sure that XMLHttpRequests always send HTTP-Referer header
grep -rlw no-referrer /var/www/html/webtop |
while read FILE
do
  sed -i 's/\bno-referrer\b/same-origin/g' "$FILE"
done
  • Configure Nginx web server for domain.com. Put this in /etc/nginx/conf.d/domain.conf
    location / {
  …

Replies: 3 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@murty2
Comment options

@DustinBrett
Comment options

@murty2
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by murty2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants