nginx

How to run two js apps on different url with Nginx?

为君一笑 提交于 2021-02-11 17:51:05
问题 I want to run two different js apps on my Nginx server. My problem is that I want to enable the React app on the main URL / on port 3000 and different js app on port 1337. When I set React App on the main URL it's working properly but any application on different URL like /admin that loads the second app it's not loaded properly. I have changed the paths and now I have my second app on main URL / and it's working properly but when I run React app on /admin URL it cannot load files properly.

nginx配置详解

拜拜、爱过 提交于 2021-02-11 15:58:46
nginx的配置在nginx下的conf/nginx.conf worker_processes 1; 进程为1,可以往高调,一般设置为 CPU数*核数 #error_log logs/error.log; 错误日志存放的位置 #pid logs/nginx.pid; pid文件存放的位置 events {   use epoll; 使用epoll的I/O 模型。nginx一般都用epoll worker_connections 1024; 这是一个子进程的连接数,可以调高 keepalive_timeout 60; 高可用的超时时间 } http {   include  mime.type:  //设定mime类型,类型由mime.type文件定义   default_type application/octet-stream;   #access_log logs/access.log main; 访问日志的开启和路径   sendfile  on;   keepalived_timeout  65;   #gzip  on;  是否开启gzip压缩   server  {     lsten  80;  监控的端口     server_name   www.yunwei.com; 域名   location / {  我的个人理解为这也是个location匹配规则    

Kubernetes Nginx Ingress can connect to https pods?

让人想犯罪 __ 提交于 2021-02-11 15:37:32
问题 I have three pods with HTTPS servers inside. I used to acces them via NodePort services. Now I deployed a Nginx Ingress to have them all in one IP. I have noticed that the Nginx Ingress can't connect with an HTTPS server in a pod, but it connects perfectly if I change it to HTTP. How can I make the Ingress connect with HTTPS servers in pods? I have tried to configure a tls secret, and add it to the Ingress: apiVersion: extensions/v1beta1 kind: Ingress metadata: name: k8s-ingress annotations:

$ssl_early_data from nginx: should the application use it somehow?

二次信任 提交于 2021-02-11 15:20:52
问题 I'm preparing to turn on nginx ssl_early_data to enable RTT-0 with TLS 1.3. I understand that, if I don't do it right, replay attacks become possible. I understand that, to prevent this, you need to also use $ssl_early_data Requests sent within early data are subject to replay attacks. To protect against such attacks at the application layer, the $ssl_early_data variable should be used. What I don't understand is if it's enough to put this directive in the nginx configuration or if/how the

certbot --nginx generates PR_END_OF_FILE_ERROR

生来就可爱ヽ(ⅴ<●) 提交于 2021-02-11 15:00:41
问题 a Ubuntu 16.04.6 LTS VPS running nginx is presently bricked in terms of serving pages through port 443. This happened unexpectedly, I assume when a renewal kicked in automatically. Following are twice replicated steps. I removed all site definitions in sites-enabled and reduced the server to its simplest expression: one application in http mode only. The output of nginx -T is at bottom. the unencrypted pages serve as expected. I then ran sudo certbot --nginx and selected 1 for the only 3rd

certbot --nginx generates PR_END_OF_FILE_ERROR

女生的网名这么多〃 提交于 2021-02-11 14:59:40
问题 a Ubuntu 16.04.6 LTS VPS running nginx is presently bricked in terms of serving pages through port 443. This happened unexpectedly, I assume when a renewal kicked in automatically. Following are twice replicated steps. I removed all site definitions in sites-enabled and reduced the server to its simplest expression: one application in http mode only. The output of nginx -T is at bottom. the unencrypted pages serve as expected. I then ran sudo certbot --nginx and selected 1 for the only 3rd

nginx ingress controller don't reach backend service?

喜你入骨 提交于 2021-02-11 14:21:14
问题 I am currently trying to expose an kubernetes service via an ingress controller, but I cannot seem to so? Who some odd reason does the host/path never resolve to the clusterIp and port that I want to use, eventhough this should have been resolved via my ingress controller and the ressource?... apiVersion: v1 kind: Service metadata: name: hello-kubernetes spec: type: LoadBalancer ports: - port: 80 targetPort: 8080 selector: app: hello-kubernetes --- apiVersion: apps/v1 kind: Deployment

How to cache NextJS 10.0 images using NGINX

时光总嘲笑我的痴心妄想 提交于 2021-02-11 14:17:58
问题 We would like to launch a NextJS 10 app using NGINX so we use a configuration similar to: location /_next/static/ { alias /home/ec2-user/my-app/.next/static/; expires 1y; access_log on; } It works great, it caches for a year our statics but as we use NextJS images I'm failing to add an expires tag on on-the-fly resized images. If I do: location /_next/image/ { alias /home/ec2-user/my-app/.next/image; expires 1y; access_log on; } It just returns a 404 on images. Here is my server part NGINX

Nginx reverse-proxy not serving static files

巧了我就是萌 提交于 2021-02-11 14:17:25
问题 I tried to start some services via docker-compose. One of them is a nginx reverse-proxy , handling different paths. One path ("/react") is to a containerized react_app with a nginx on port 80. Solely, the reverse-proxy is working correctly. Also, if I server the nginx of the react_app on port 80, all work's fine. Combining both without changing anything in the config leads to 404 for static files like css and js. Setup #1 Correct forward for path /test to Google. docker-compose.yml version:

Nginx reverse-proxy not serving static files

可紊 提交于 2021-02-11 14:13:56
问题 I tried to start some services via docker-compose. One of them is a nginx reverse-proxy , handling different paths. One path ("/react") is to a containerized react_app with a nginx on port 80. Solely, the reverse-proxy is working correctly. Also, if I server the nginx of the react_app on port 80, all work's fine. Combining both without changing anything in the config leads to 404 for static files like css and js. Setup #1 Correct forward for path /test to Google. docker-compose.yml version: