Skip to content

Instantly share code, notes, and snippets.

@karabasosman
Created August 26, 2022 01:50
Show Gist options
  • Save karabasosman/a80c23b21115be5e50d18379c28aa09b to your computer and use it in GitHub Desktop.
Save karabasosman/a80c23b21115be5e50d18379c28aa09b to your computer and use it in GitHub Desktop.
#!/bin/bash
echo "[CUSTOM STARTUP SCRIPT] Fixing trailing slash issue by adapting Nginx configuration file"
replace="server {"
replaceWith="server { absolute_redirect off;"
sed -i "s/${replace}/${replaceWith}/g" /etc/nginx/sites-available/default
echo "[CUSTOM STARTUP SCRIPT] Reloading nginx to apply new configuration"
service nginx reload
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment