Pretty URLs feature via GET param? #231
-
Hey SQLPagers, Has anyone run into the need to display pretty urls for certain routes? For instance, instead of For static links, I believe this is possible like so:
But it would be ideal to permit something more dynamic, such as:
(where If it's not already built-in, I wonder if rewriting the URL based on a given get parameter might be feasible. For instance, via a configuration setting that watches for a declared Where something like: {
"allow_exec" : true,
"port" : "3001",
"pretty_param" : "q"
} would instruct SQLPage to rewrite |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hello ! SQLPage itself does not have built-in support for URL rewriting. However, you can achieve this by using a reverse proxy in front of SQLPage. Here's a step-by-step guide to setting up nginx as a reverse proxy for SQLPage with URL rewriting:
Now, your SQLPage should be accessible through Nginx, and URLs like Other benefitsUsing a reverse proxy not only enables URL rewriting but also provides additional benefits like :
|
Beta Was this translation helpful? Give feedback.
-
Just in case someone would stumble on this discussion: there is now a guide to using a reverse proxy in front of sqlpage on the website: https://sql.ophir.dev/your-first-sql-website/nginx.sql |
Beta Was this translation helpful? Give feedback.
Hello !
SQLPage itself does not have built-in support for URL rewriting. However, you can achieve this by using a reverse proxy in front of SQLPage.
Here's a step-by-step guide to setting up nginx as a reverse proxy for SQLPage with URL rewriting:
Install Nginx:
Ensure that Nginx is installed on your server. On debian or ubuntu you can do this by running:
Configure Nginx:
Create a new Nginx configuration file for your SQLPage. For example, create a file named
sqlpage.conf
in the Nginx configuration directory:Nginx Configuration:
Add the following configuration, adjusting the values as n…