Comments (7)
Hi,
Take a look at the document (https://unit.nginx.org/scripting/#scripting).
There are only a few common variables supported for now.
Btw, we'll support the variables accessing with njs in the next version.
Here's the PR(#1024), welcome to try it.
from unit.
Good morning! The uri
does NOT include the arguments. We have to use request_uri
for that. The request_uri
will be available in NJS within the next release as mentioned.
Furthermore I think it will be benefitial for everybody if we would provide NJS functions in files easy to consume for such use cases.
Without saying: We have to provide a easy to use solution for such use cases for users like @veremax! So, thanks for testing this @veremax and letting us know. We are working on a solution that will make this A LOT! easier with Unit 1.32 which we are about to ship within the next 4 weeks.
from unit.
I think we should keep this issue open as long as we are working on resolving the issue with the request arguments and rewrites.
from unit.
@tippexs Are there cleaner ways to strip www.
from hostnames and provide http->https redirection?
from unit.
For compactness (don't hate me!)
{
"action": {
"return": 301,
"location": "`${'https://' + host.substr(host.startsWith('www.')*4) + uri}`"
}
}
from unit.
For compactness (don't hate me!)
{ "action": { "return": 301, "location": "`${'https://' + host.substr(host.startsWith('www.')*4) + uri}`" } }
Unfortunately, after redirection you will lose parameters after "?" (query_string)
from unit.
@tippexs @lcrilly @hongzhidao @
Thank you very much!
from unit.
Related Issues (20)
- unitctl not installed with `brew install nginx/unit/unit` on macOS HOT 3
- NGINX UNIT "PHP" application is not supported on RHEL 9
- Unit not starting WAR File HOT 2
- Badge colors don't match NGINX colors
- nginx unit php server stops responding when using supervisor HOT 2
- BUG: Environment Variables not passed to Wasm Applications HOT 4
- Error: Cannot find module 'unit-http/loader' HOT 3
- Error 503, PHP HOT 8
- [Feature Request] Basic Authentication for Control Socket HOT 3
- CLI: subcommand for saving configuration HOT 3
- CLI: deploy configuration to many instances HOT 3
- CLI: SSH Support HOT 4
- Unit is not compiled with php, njs and wasm-wasi-component HOT 5
- Node.js: Unable to run due to Server this.on is not a function HOT 4
- "Waiting for Server Response" time consistently different depending on POST DATA Length? HOT 9
- http2 on; doesnt work as expected HOT 2
- RHEL Packages: GPG check fails when explicitly enabled HOT 9
- Query control API to show the loaded modules HOT 9
- Change server name header HOT 1
- Add error code and error message as variables at error page HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from unit.