From wee.s at forest.go.th Wed Dec 4 10:42:39 2019 From: wee.s at forest.go.th (Wee Sritippho) Date: Wed, 4 Dec 2019 17:42:39 +0700 Subject: static file url rewrite Message-ID: <89b6245b-6e1c-f2dc-326f-c0a1265928a1@forest.go.th> Hi all, I'm using nginx unit to serve my Vue.js app and trying to redirect every uri (except '/api/*') to the app. In nginx, I can do something like this: location / { try_files $uri $uri/ /index.html; } How can I do the same using nginx unit? Thank you, Wee. My current config (which results in 404 Error when trying to access every uri except '/' and '/api/*'): { "listeners": { "*:5000": { "pass": "routes" } }, "applications": { "flask_app": { "type": "python 3", "path": "/app/", "home": "/venv/", "module": "app" } }, "routes": [ { "match": { "uri": "/api/*" }, "action": { "pass": "applications/flask_app" } }, { "action": { "share": "/app/static/" } } ] } From vbart at nginx.com Wed Dec 4 18:57:32 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Wed, 04 Dec 2019 21:57:32 +0300 Subject: static file url rewrite In-Reply-To: <89b6245b-6e1c-f2dc-326f-c0a1265928a1@forest.go.th> References: <89b6245b-6e1c-f2dc-326f-c0a1265928a1@forest.go.th> Message-ID: <15152319.2uDWbh0HEt@vbart-workstation> On Wednesday 04 December 2019 17:42:39 Wee Sritippho wrote: > Hi all, > > I'm using nginx unit to serve my Vue.js app and trying to redirect every > uri (except '/api/*') to the app. > > In nginx, I can do something like this: > > location / { > try_files $uri $uri/ /index.html; > } > > How can I do the same using nginx unit? [..] Unfortunately, right now there's no way in Unit to make routing decisions based on presence of file system objects. Although this feature is planned. Currently you can try to specify all static content, that you have in your application. See here for example: - https://unit.nginx.org/configuration/#id1 wbr, Valentin V. Bartenev From wee.s at forest.go.th Fri Dec 6 08:38:13 2019 From: wee.s at forest.go.th (Wee Sritippho) Date: Fri, 6 Dec 2019 15:38:13 +0700 Subject: static file url rewrite In-Reply-To: <15152319.2uDWbh0HEt@vbart-workstation> References: <89b6245b-6e1c-f2dc-326f-c0a1265928a1@forest.go.th> <15152319.2uDWbh0HEt@vbart-workstation> Message-ID: <416ab324-af2d-3e09-b5c6-cfd8fd0c0125@forest.go.th> I tried specifying one of my vue router-link in the route but still receive a 404 error. Guess I'll have to fall back to other solutions for now. Thank you. On 5/12/2562 1:57, Valentin V. Bartenev wrote: > On Wednesday 04 December 2019 17:42:39 Wee Sritippho wrote: > [..] > > Unfortunately, right now there's no way in Unit to make routing decisions based > on presence of file system objects. Although this feature is planned. > > Currently you can try to specify all static content, that you have in your > application. See here for example: > > - https://unit.nginx.org/configuration/#id1 > > wbr, Valentin V. Bartenev > From cankhoa254 at gmail.com Sun Dec 8 09:49:05 2019 From: cankhoa254 at gmail.com (=?UTF-8?B?S2hvYSBD4bqlbg==?=) Date: Sun, 8 Dec 2019 16:49:05 +0700 Subject: static file url rewrite In-Reply-To: <416ab324-af2d-3e09-b5c6-cfd8fd0c0125@forest.go.th> References: <89b6245b-6e1c-f2dc-326f-c0a1265928a1@forest.go.th> <15152319.2uDWbh0HEt@vbart-workstation> <416ab324-af2d-3e09-b5c6-cfd8fd0c0125@forest.go.th> Message-ID: i don't want your envolope V?o Th 6, 6 thg 12, 2019 va?o lu?c 15:38 Wee Sritippho ?? vi?t: > I tried specifying one of my vue router-link in the route but still > receive a 404 error. Guess I'll have to fall back to other solutions for > now. > > Thank you. > > On 5/12/2562 1:57, Valentin V. Bartenev wrote: > > On Wednesday 04 December 2019 17:42:39 Wee Sritippho wrote: > > [..] > > > > Unfortunately, right now there's no way in Unit to make routing > decisions based > > on presence of file system objects. Although this feature is planned. > > > > Currently you can try to specify all static content, that you have in > your > > application. See here for example: > > > > - https://unit.nginx.org/configuration/#id1 > > > > wbr, Valentin V. Bartenev > > > > _______________________________________________ > unit mailing list > unit at nginx.org > https://mailman.nginx.org/mailman/listinfo/unit > -- fun -------------- next part -------------- An HTML attachment was scrubbed... URL: From vbart at nginx.com Fri Dec 27 13:38:50 2019 From: vbart at nginx.com (Valentin V. Bartenev) Date: Fri, 27 Dec 2019 16:38:50 +0300 Subject: Unit 1.14.0 release Message-ID: <1800062.Q240i01HPy@vbart-workstation> Hi, I'm glad to announce a new release of NGINX Unit. Besides improving the request routing abilities, this release simplifies operations concerning the Go module. Now it can also be installed with the "go get" command: go get unit.nginx.org/go Mind, however, that it requires the "unit-dev" package. Great effort went into improving the efficiency and avoiding memory bloat in cases where an application generates gigabytes of response body. Now Unit can deal with that without much hassle. We will continue improving the performance and increasing efficiency, as this is one of our primary priorities. Changes with Unit 1.14.0 26 Dec 2019 *) Change: the Go package import name changed to "unit.nginx.org/go". *) Change: Go package now links to libunit instead of including library sources. *) Feature: ability to change user and group for isolated applications when Unit daemon runs as an unprivileged user. *) Feature: request routing by source and destination addresses and ports. *) Bugfix: memory bloat on large responses. We also updated our Docker images and switched them from Debian 9 to 10 as the base, so the language module versions have been updated respectively. - https://unit.nginx.org/installation/#docker-images Python 3.6 module packages were added to CentOS and RHEL 7 repositories, and Python 3.7 package was added to Amazon Linux 2 LTS. Please note that the name of Python 2.7 package in these repositories was changed from "unit-python" to "unit-python27". The Go package now has the same name "unit-go" across all our repositories and depends on "unit-dev". This is the last release of 2019, so I'll use this opportunity to wish a Happy New Year to our strong community. Thank you for your requests, bug reports, ideas, and suggestions. Everything that we do, we primarily do for you, our users. This year, we made 8 releases, with 427 commits to the repository, where 65242 lines were added and 8219 removed. The biggest features of the year are: - Support for Java Servlet Containers, which means that now Unit supports 7 languages - Advanced internal request routing that allows to filter requests by various parameters, including: URI, header fields, arguments, cookies, addresses, and ports - Built-in WebSocket server offloading for Node.js and Java - Isolation of application processes - Serving of static files - Reverse proxying These features establish a firm basis for further development of Unit as a general-purpose web server that is able to perform absolutely any task related to handling and processing web protocols in the most efficient way. This is our ultimate goal, and we are eager to achieve it over the coming years. I'd like to thank everyone who worked hard with me on Unit through the year: - Andrei Belov - system engineer, who maintained repositories and prepared packages - Andrei Zeliankou - QA engineer, who wrote functional tests and ran fuzzing - Artem Konev - technical writer, who wrote documentation and blog posts, improved the website, and sometimes helped us to arrange words in sentences the right way - Axel Duch - junior developer, who improved request routing - Igor Sysoev - senior developer and architect, who worked on request routing, proxying, and many internal aspects - Konstantin Pavlov - system engineer, who prepared Docker images and packages - Maxim Romanov - senior developer, who worked on Java, WebSockets, and internal IPC - Tiago Natel de Moura - senior developer, who worked on isolation features Thank you guys, I'm happy to work with you. wbr, Valentin V. Bartenev