nginx

routing subdomain to subdirectory on nginx

[亡魂溺海] 提交于 2021-02-08 10:28:23
问题 Please help as explicitly as possible. I have set up a domain on a home server running nginx on Ubuntu 15, and I have the dns pointed to it. I can use the domain to access the site and if I append /subdirectory to it, I am able to launch the pages inside the subdirectories. What I am trying to do is get the subdomains to go directly to the correct root. Ie: mysite.com = /index.htm, subdomain.mysite.com = ./subdirectory where files are located. I have tried every suggestion including those

Docker nginx websocket proxy== client closed connection while waiting for request

孤街醉人 提交于 2021-02-08 10:14:33
问题 I desperately trying to setup nginx proxy to websocket. Websocket connects but then I'm getting 2018/02/10 19:30:34 [info] 7#7: *238 client closed connection while waiting for request, client: 172.18.0.1, server: 0.0.0.0:8888 Here's the minimal example: nginx.conf worker_processes 1; events { worker_connections 1024; } error_log /dev/stdout debug; http { resolver 127.0.0.11 ipv6=off; include mime.types; access_log /dev/stdout; default_type application/octet-stream; sendfile on; keepalive

Nginx config rewrite with PATH_INFO

倾然丶 夕夏残阳落幕 提交于 2021-02-08 10:13:54
问题 I create .htaccess file in folder /var/www/project/ : <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^(statics/([a-zA-Z0-9\-\/.]+)|index\.php)$ #ignore folder statics RewriteRule ^([a-zA-Z0-9\-\/.]+)$ index.php/$1 [QSA,L] #Add path_info </IfModule> <Files *.php> Order Deny,Allow Deny from all </Files> <Files index.php> Order Allow,Deny Allow from all </Files> index.php: <?php echo 'Path: ', $_SERVER['PATH_INFO'

Change index.html nginx kubernetes deployment

放肆的年华 提交于 2021-02-08 10:12:58
问题 I have this deployment: I was able to edit the index page at one of my pods, but how can I commit it to the deployment image? So when I scale the application all new pods will have the same image with index edited. 回答1: It's worked for me apiVersion: v1 kind: Pod metadata: name: nginx labels: name: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80 volumeMounts: - mountPath: /usr/share/nginx/html/index.html name: nginx-conf subPath: index.html volumes: - name: nginx

Cannot get header that contains a period from NGINX

女生的网名这么多〃 提交于 2021-02-08 10:10:33
问题 The header "Abp.TenantId" is null because of the "." . If remove the "." (like "AbpTenantId" ), it will be ok. How to add a header with a "." ? ======================================================= localhost debug: Provisional headers are shown (show this on client request) Request.Headers.Unknown (show this in server, api action) Request.Headers.MaybeUnknown (show this in server, api action) localhost is ok. The same code in server, but server error. The code for the tenantId : The logs

Change index.html nginx kubernetes deployment

一个人想着一个人 提交于 2021-02-08 10:10:09
问题 I have this deployment: I was able to edit the index page at one of my pods, but how can I commit it to the deployment image? So when I scale the application all new pods will have the same image with index edited. 回答1: It's worked for me apiVersion: v1 kind: Pod metadata: name: nginx labels: name: nginx spec: containers: - name: nginx image: nginx ports: - containerPort: 80 volumeMounts: - mountPath: /usr/share/nginx/html/index.html name: nginx-conf subPath: index.html volumes: - name: nginx

implement https on nginx config file

泄露秘密 提交于 2021-02-08 10:02:47
问题 I have a single page application written with vuejs and i want to deploy the application using digitalocean, nginx and docker my question is, what do i need to add to the config file/docker file to make that the app will use https and not http? (i'm going to use self signed certificates) yes, i searched the question already, but nothing seems to work with that template. also, the backend for this app is nodejs with express that will be on different container on the same digital ocean server

Cannot get header that contains a period from NGINX

ⅰ亾dé卋堺 提交于 2021-02-08 10:01:33
问题 The header "Abp.TenantId" is null because of the "." . If remove the "." (like "AbpTenantId" ), it will be ok. How to add a header with a "." ? ======================================================= localhost debug: Provisional headers are shown (show this on client request) Request.Headers.Unknown (show this in server, api action) Request.Headers.MaybeUnknown (show this in server, api action) localhost is ok. The same code in server, but server error. The code for the tenantId : The logs

Dependency archiving for airgapped network

爷,独闯天下 提交于 2021-02-08 09:24:11
问题 I am trying to use Bazel in a network which is not connected to the internet. Even without using any special libraries, Bazel still needs to download some dependencies via HTTP. I was advised to try and set up an HTTP proxy server which will cache the files which Bazel downloads, and then transfer the proxy server along with its cache into our isolated network. In order for this to work, I need to be able to operate the proxy in two modes: When creating the cache, the proxy caches all

What's the easiest way to rotate nginx log files monthly?

夙愿已清 提交于 2021-02-08 09:20:07
问题 In OpenBSD, there's no logrotate in ports, and newsyslog seems to have limited features as far as monthly rotation of a huge number of log files is concerned. I have a lot of domains, a huge number of nginx log-files names like /var/www/logs/*/*.{access,error}.log . I'm thinking a small shell script and cronjob. What would be the easiest way to rotate them all monthly, and append the prior month to the filename? 回答1: I think the following crontab should work: 0 0 1 * * /etc/nginx/logrotate