question
stringlengths
11
28.2k
answer
stringlengths
26
27.7k
tag
stringclasses
130 values
question_id
int64
935
78.4M
score
int64
10
5.49k
I’m trying to delete by a secondary index or column key in a table. I'm not concerned with performance as this will be an unusual query. Not sure if it’s possible? E.g.: CREATE TABLE user_range ( id int, name text, end int, start int, PRIMARY KEY (id, name) ) cqlsh> select * from dat.user_range where id=7745...
No, deleting by using a secondary index is not supported: CASSANDRA-5527
Cassandra
18,515,874
16
I know that there are TTLs on columns in Cassandra. But is it also possible to set a TTL on a row? Setting a TTL on each column doesn't solve my problem as can be seen in the following usecase: At some point a process wants to delete a complete row with a TTL (let's say row "A" with TTL 1 week). It could do this by rep...
There is no way of setting a TTL on a row in Cassandra currently. TTLs are designed for deleting individual columns when their lifetime is known when they are written. You could achieve what you want by delaying your process - instead of wanting to insert a TTL of 1 week, run it a week later and delete the row. Row d...
Cassandra
16,544,051
16
Are there any distinct advantages for using cql over thrift or is it simply a case of developers being too used to SQL? I'm wanting to switch from thrift querying to cql, the only problem is I'm not sure about the downsides of doing so. What are they?
Lyuben's answer is a good one, but I believe he may be misinformed on a few points. First, you should be aware that the Thrift API is not going to be getting new features; it's there for backwards compatibility, and not recommended for new projects. There are already some features that can not be used through the Thrif...
Cassandra
15,701,263
16
I'm attempting to insert a modified document back to Cassandra DB with a new key. I'm having hard time figuring out what is the issue the error message is pointing at. When looking for others that have had similar problems the answers seem to be related to the keys, and in my case the None is just a value of few of the...
The "no viable alternative" means that the data type for some key doesn't match the schema for that column family column, unfortunately it doesn't plainly say that in the error message. In my case the data type for meta was: map<text,text> for this reason None was considered a bad value at insertion time. I fixed t...
Cassandra
14,897,599
16
I'm planning to insert data to bellow CF that has compound keys. CREATE TABLE event_attend ( event_id int, event_type varchar, event_user_id int, PRIMARY KEY (event_id, event_type) #compound keys... ); But I can't insert data to this CF from python using cql. (http://code.google.com/a/apache-extras....
It looks like you are trying to follow the example in: http://pypi.python.org/pypi/cql/1.4.0 import cql con = cql.connect(host, port, keyspace) cursor = con.cursor() cursor.execute("CQL QUERY", dict(kw='Foo', kw2='Bar', kwn='etc...')) However, if you only need to insert one row (like in your question), just drop the e...
Cassandra
13,217,434
16
My team has asked me to choose between Cassandra and SOLR for faster response @ frond end queries. I told them that Cassandra is NOSQL db thing while SOLR is indexing thing. But then they say that we can push our complete db to SOLR (like using SOLR as db) or we can just use Cassandra with SOLR. All confused. Amount o...
If you don't need Solr's full-text search capabilities, there's very little reason to choose it over Cassandra, in my opinion. (Disclosure: I work for DataStax.) Operationally, handling a Cassandra cluster will be much simpler due to the Dynamo-based architecture. Sharding Solr can be quite painful, which is one of th...
Cassandra
10,184,858
16
I would like to know whenever it is possible in Cassandra to specify unique constrain on row key. Something similar to SQL Server's ADD CONSTRAINT myConstrain UNIQUE (ROW_PK) In case of insert with already existing row key, the existing data will be not overwritten, but I receive kind of exception or response that upda...
Lightweight transactions? http://www.datastax.com/documentation/cassandra/2.0/cassandra/dml/dml_ltwt_transaction_c.html INSERT INTO customer_account (customerID, customer_email) VALUES (‘LauraS’, ‘lauras@gmail.com’) IF NOT EXISTS;
Cassandra
8,154,332
16
How do you rename a live Cassandra keyspace through the cassandra-cli? Previous versions had an option in cassandra-cli ("rename keyspace"). However, that option has been dropped in recent releases.
Renaming keyspaces (and column families) is no longer supported, since it was prone to race conditions. See https://issues.apache.org/jira/browse/CASSANDRA-1585.
Cassandra
7,649,104
16
I found a lot. But which one is the best? And why? I didn't find yet anything really complete and centralized in one good article or documentation. At least a good book? Thanks.
Our (Riptano's) Cassandra documentation is probably the best one-stop resource: http://www.riptano.com/docs A good complement from the ASF wiki is http://wiki.apache.org/cassandra/ArticlesAndPresentations.
Cassandra
4,536,211
16
I think these three are the most popular non-relational db:s out there at this moment. I want to give them a try, but I wonder which one of these are most suitable for Rails when it comes to Gem, documentation and tutorial support. Eg. if I install a very good gem that is for Rails but this just use AR and mongodb, the...
To make an informed selection, you'll really need to know your data model. MongoDB and CouchDB are document-oriented data stores. Cassandra is quite different, it is a bit more special-purpose and its distributed design is its strength. It's more of a distributed key/value store but with slicing, timestamp sorting, ran...
Cassandra
3,550,306
16
Consider a M:M relation that needs to be represented in a Cassandra data store. What M:M modeling options are available? For each alternative, when is it to prefer? What M:M modeling choices have you made in your Cassandra powered projects?
Instead of using a join table the way you would with an rdbms, you would have one ColumnFamily containing a row for each X and a list of Ys associated with it, then a CF containing a row for each Y and a list of each X associated with it. If it turns out you don't really care about querying one of those directions then...
Cassandra
2,573,106
16
Apache cassandra version 3.7 is running on Ubuntu server 16.04 fine, all parts of apache cassandra started up no problem, the issue is, i go to connect using cqlsh: $ CQLSH (My IP Address) 9160 then it says: Connection error: ('Unable to connect to any servers', {'10.0.0.13': TypeError('ref() does not take keyword arg...
As described in the ticket - define environment variable CQLSH_NO_BUNDLED and export it. export CQLSH_NO_BUNDLED=true It will tell cqlsh (which is Python program) to use external Cassandra Python driver, not the one bundled with the distribution. The bundled Cassandra driver is located in /opt/datastax-ddc-3.7.0/bin, ...
Cassandra
38,883,435
15
I am new to cassandra and I am using it for analytics tasks (good indexing needed ). I read in this post (and others): cassandra, select via a non primary key that I can't query my DB with a non-primary key columns with WHERE clause. To do so, it seems that there is 3 possibilities (ALL with major disadvantages): Crea...
From within Cassandra itself you are limited to the options that you have specified above. If you want to know why take a look here: A Deep Look to the CQL Where Clause However if you are trying to run analytics on information stored within Cassandra then have you looked at using Spark. Spark is built for large scale...
Cassandra
35,524,516
15
I am doing a large migration from physical machines to ec2 instances. As of right now I have 3 x.large nodes each with 4 instance store drives (raid-0 1.6TB). After I set this this up I remembered that "The data on an instance store volume persists only during the life of the associated Amazon EC2 instance; if you stop...
I have been running Cassandra on EC2 for over 2 years. To address your concerns, you need to form a proper availability architecture on EC2 for your Cassandra cluster. Here is a bullet list for you to consider: Consider at least 3 zones for setting up your cluster; Use NetworkTopologyStrategy with EC2Snitch/EC2MultiRe...
Cassandra
21,386,671
15
I use Cassandra DB and Helenus module for nodejs to operate with this. I have some rows which contains TimeUUID columns. How to get timestamp from TimeUUID in javascript?
this lib ( UUID_to_Date ) is very simple and fast!! only used native String function. maybe this Javascript API can help you to convert the UUID to date format, Javascript is simple language and this simple code can help to writing API for every language. this API convert UUID v1 to sec from 1970-01-01 all of you ne...
Cassandra
17,571,100
15
I was just wondering what would be the best way to backup an entire keyspace in Cassandra... what do you think? Previously i just copied the data folder into my backup hard drive, but then i had problems to restore the database after updating.
The best way is by doing snapshots (nodetool snapshot). You can learn a lot about how that works and how best to use it in this Datastax documentation (disclaimer: I work for Datastax). You'll want to make sure you have JNA enabled (some relevant instructions can be found on this page). If you do, snapshots are extreme...
Cassandra
10,466,192
15
I've searched on this topic and can't find anything in the nginx configuration that says if this is "ok" or not? This appears to work just fine, other than messing up the syntax highlighting in vim: add_header Content-Security-Policy "default-src 'self' *.google-analytics.com; objec...
You can use variable nesting like this, which still in the end creates a one liner: set $SCRIPT "script-src 'self'"; set $SCRIPT "${SCRIPT} https://www.a.com"; # comment each line if you like set $SCRIPT "${SCRIPT} https://b.com"; set $STYLE "style-src 'self'"; set $STYLE "${STYLE} https://a.com"; set $IMG "img-src 'se...
NGINX
50,018,881
36
I am trying to use some site of mine as an iframe from a different site of mine. My problem is- the other site is always consistently changes his IP address and does not have an domain name. So, I read that you can allo a specific domain by adding this lint to the /etc/nginx/nginx.conf: add_header X-Frame-Options "ALL...
If you set it, then you can only set it to DENY, SAMEORIGIN, or ALLOW-FROM (a specific origin). Allowing all domains is the default. Don't set the X-Frame-Options header at all if you want that. Note that the successor to X-Frame-Options — CSP's frame-ancestors directive — accepts a list of allowed origins so you can ...
NGINX
44,436,659
36
So i am using following settings to create one reverse proxy for site as below. server { listen 80; server_name mysite.com; access_log /var/log/nginx/access.log; error_log /var/log/nginx/error.log; root /home/ubuntu/p3; location / { proxy_pass https://mysiter.com/; proxy_redi...
Seeing the exact same error on Nginx 1.9.0 and it looks like it was caused by the HTTPS endpoint using SNI. Adding this to the proxy location fixed it: proxy_ssl_server_name on; https://en.wikipedia.org/wiki/Server_Name_Indication http://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_ssl_server_name
NGINX
38,931,468
36
I have a problem with my nginx+uwsgi configuration for my django app, I keep getting this errors in the uwsgi error log: Wed Jan 13 15:26:04 2016 - uwsgi_response_writev_headers_and_body_do(): Broken pipe [core/writer.c line 296] during POST /company/get_unpaid_invoices_chart/ (86.34.48.7) IOError: write error Wed Jan...
The problem is that clients abort the connection and then Nginx closes the connection without telling uwsgi to abort. Then when uwsgi comes back with the result the socket is already closed. Nginx writes a 499 error in the log and uwsgi throws a IOError. The non optimal solution is to tell Nginx not to close the socke...
NGINX
34,768,527
36
I am trying add CORS directive to my nginx file for as simple static HTML site. (taken from here http://enable-cors.org/server_nginx.html) Would there be a reason why it would complain about the first add_header directive saying 'add_header" directive is not allowed here' My config file sample server { if ($http_or...
The rule if in location can be bypassed by some tricks, so that you don't have to write/include CORS rules in every location block. server { set $cors_origin ""; set $cors_cred ""; set $cors_header ""; set $cors_method ""; if ($http_origin ~* "^http.*\.yourhost\.com$") { set $cors_ori...
NGINX
27,955,233
36
Nginx was working fine on Mavericks, and now after I upgraded to Yosemite its displaying nginx command not found , I tried to install nginx with brew install nginx and it displays an error Error: You must brew link pcre before nginx can be installed And brew link pcre displays Linking /usr/local/Cellar/pcre/8.35... E...
I had the same problem, that is, after upgrading from Mavericks to Yosemite I got the following error: nginx: [emerg] mkdir() "/usr/local/var/run/nginx/client_body_temp" failed (2: No such file or directory) All I needed to do to solve this issue was to create the folder: mkdir -p /usr/local/var/run/nginx/client_body_t...
NGINX
26,450,085
36
I have a config file with a virtual server setup, this is running on port 443 for ssl. I would also like this same virtual server to handle non ssl traffic on port 80. I was hoping to do the following but it doesn't seem to work. server { listen 443 ssl; listen 80; server_name example.com; ... } It loo...
Yes, of course. server { listen 80; listen 443 ssl; # force https-redirects if ($scheme = http) { return 301 https://$server_name$request_uri; } } Here is my post, name "Nginx Configuration for HTTPS" which contains more info.
NGINX
25,399,814
36
I want to check if a parameter is present in a url in nginx and then rewrite.How can i do that? For e.g if url is http://website.com/?mobile then redirect user to http://m.website.com
You better use http://example.com/?mobile=1 (argument with value). In this case checking is simple: if ($arg_mobile) { return 302 http://m.example.com/; } Checking for argument existance is usually done with regexp like if ($args ~ mobile) but it's error-prone, because it will match mobile anywhere, e.g. http://ex...
NGINX
23,988,344
36
I'm having a lot of trouble setting up this alias inside nginx to display my website correctly. The website I'm concerned with should be accessible from mywebsite.com/mr and is different from the site located at mywebsite.com/. The website is located at /fullpath (shortened for simplicity) The site needs to serve three...
Apparently alias and try_files don't work together. However, I don't think you need to use alias. location /mr { default_type "text/html"; try_files /fullpath/$uri /fullpath/$uri.html /fullpath/$uri/index.html /fullpath/index.html; } Which would try: Exact file. File with .html added. Index in the path. Default...
NGINX
15,451,191
36
The idea is to take incoming requests to http://abc.example.com/... and rewrite them to http://example.com/abc/... That's easy enough to do with a 301/302 redirect: # rewrite via 301 Moved Permanently server { listen 80; server_name abc.example.com; rewrite ^ $scheme://example.com/abc$request_uri permanent; } Th...
# abc.example.com server { listen 80; server_name abc.example.com; location / { proxy_pass http://127.0.0.1/abc$request_uri; proxy_set_header Host example.com; } }
NGINX
14,491,944
36
I'm running nginx, Phusion Passenger and Rails. I am running up against the following error: upstream sent too big header while reading response header from upstream, client: 87.194.2.18, server: xyz.com, request: "POST /user_session HTTP/1.1", upstream: "passenger://unix:/tmp/passenger.3322/master/helper_server.sock ...
Try to add this to the config: http { ... proxy_buffers 8 16k; proxy_buffer_size 32k; }
NGINX
2,307,231
36
I am a docker beginner and the first thing i did was download nginx and tried to mount it on 80:80 port but Apache is already sitting there. docker container run --publish 80:80 nginx and docker container run --publish 3000:3000 nginx I tried doing it like this 3000:3000 to use it on port 3000 but it doesn't work .An...
The accepted answer does not change the actual port that nginx is starting up on. If you want to change the port nginx starts up on inside the container, you have to modify the /etc/nginx/nginx.conf file inside the container. For example, to start on port 9080: Dockerfile FROM nginx:1.17-alpine COPY <your static conte...
NGINX
47,364,019
35
I'm using Namecheap Domains and Vultr Hosting. I'm trying to redirect DNS www to non-www. www.example.com to example.com I contacted Vultr and asked how to do this with their DNS Manager, they said they would not help as it is self-managed. So I contacted Namecheap, they said they would not help becuase they don't h...
DNS cannot redirect your www site to non-www. The only purpose of DNS is to point both www and non-www to your server's IP address using A, AAAA or CNAME records (it makes little difference). The nginx configuration is responsible for performing the redirect from www to non-www. Your second server block is intended to ...
NGINX
43,081,780
35
I configured nginx installation and configuration (together with setup SSL certificates for https site) via ansible. SSL certificates are under passphrases. I want to write ansilbe task which is restarting nginx. The problem is the following. Normally, nginx with https site inside asks for PEM pass phrase during resta...
Nginx has ssl_password_file parameter. Specifies a file with passphrases for secret keys where each passphrase is specified on a separate line. Passphrases are tried in turn when loading the key. Example: http { ssl_password_file /etc/keys/global.pass; ... server { server_name www1.example.com; ...
NGINX
33,084,347
35
I'm now deploying an django app with nginx and gunicorn on ubuntu 12. And I configure the nginx virtual host file as below: server { listen 80; server_name mydomain.com; access_log /var/log/nginx/gunicorn.log; location / { proxy_pass http://127.0.0.1:8000; proxy_set_header Host $host; ...
You should use alias instead of root. root appends the trailing URL parts to your local path (e.g. http://test.ndd/trailing/part, it will add /trailing/part to your local path). Instead of that, alias does exactly what you want: when http://test.ndd/static/ is requested, /static is mapped to your alias exactly, without...
NGINX
26,237,936
35
I have a location block as location @test{ proxy_pass http://localhost:5000/1; } but nginx complains that "proxy_pass cannot have URI part in location given by regular expression..." Does anyone know what might be wrong? I'm trying to query localhost:5000/1 when an upload is complete: location /upload_attachment ...
Technically just adding the URI should work, because it's documented here and it says that it should work, so location @test{ proxy_pass http://localhost:5000/1/; # with a trailing slash } Should have worked fine, but since you said it didn't I suggested the other way around, the trick is that instead of passing ...
NGINX
21,662,940
35
I've been doing web-programming for a while now and am quite familiar with the LAMP stack. I've decided to try playing around with the nginx/starman/dancer stack and I'm a bit confused about how to understand, from a high-level, how all the pieces relate to each other. Setting up the stack doesn't seem as straight forw...
I've spent the last day reading about the various components and I think I have enough of an understanding to answer my own question. Most of my answer can be found in various places on the web, but hopefully there will be some value to putting all the pieces in one place: Nginx: The first and most obvious piece of th...
NGINX
12,127,566
35
Is it possible to serve precompiled assets with nginx directly? Serving assets dynamically with Rails is like 20 times slower (4000 req/sec vs 200 req/sec in my virtualbox). I guess it can be done with some rewrite rule in nginx.conf. The problem is, however, that these filenames include md5 hash of the content, so I d...
Following on from above with some extra bits I gleaned from the interweb: For Rails 3.1: location ~* ^/assets/ { # Per RFC2616 - 1 year maximum expiry # http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html expires 1y; add_header Cache-Control public; # Some browsers still send conditional-GET req...
NGINX
6,402,278
35
We're working on a Ruby on Rails app that needs to take advantage of html5 websockets. At the moment, we have two separate "servers" so to speak: our main app running on nginx+passenger, and a separate server using Pratik Naik's Cramp framework (which is running on Thin) to handle the websocket connections. Ideally, wh...
You can't use nginx for this currently[it's not true anymore], but I would suggest looking at HAProxy. I have used it for exactly this purpose. The trick is to set long timeouts so that the socket connections are not closed. Something like: timeout client 86400000 # In the frontend timeout server 86400000 # In the ba...
NGINX
2,419,346
35
I got this error in nginx error log: SSL_do_handshake() failed (SSL: error:141CF06C:SSL routines:tls_parse_ctos_key_share:bad key share) while SSL handshaking I use Let's Encrypt currently. Any ideas to solve this problem? Thank you, guys.
This isn't your problem. The best thing you can do in this situation is just to keep your server reasonably updated and secured. At best for you, the client side of a request was running seriously outdated software, and at worst your server is simply being scanned for vulnerabilities by compromised devices connected to...
NGINX
65,854,933
34
I want to build a single page application with Vue.js using Nginx as my webserver and a my own Dropwiward REST API. Moreover I use Axios to call my REST request. My nginx config looks like server { listen 80; server_name localhost; location / { root path/to/vue.js/Project; in...
Add the following code to your Nginx Config, as detailed in the VueRouter docs, here: location / { try_files $uri $uri/ /index.html; } Also, you need to enable history mode on VueRouter: const router = new VueRouter({ mode: 'history', routes: [...] })
NGINX
47,655,869
34
I've a docker container running nginx which is writing logs to /var/log/nginx Logrotate is installed in the docker container and the logrotate config file for nginx is set up correctly. Still, the logs are not being automatically rotated by logrotate. Manually forcing log rotate to rotate the logs via logrotate -f /pat...
As stated on the edit on my question the problem was that CMD from nginx:1.11 was only starting the nginx process. A work around is to place the following command on my Dockerfile CMD service cron start && nginx -g 'daemon off;' This will start nginx as nginx:1.11 starts it and well as start the cron service. The Dock...
NGINX
46,323,978
34
I am trying to configure NGINX as a forward proxy to replace Fiddler which we are using as a forward proxy. The feature of Fiddler that we use allows us to proxy ALL incoming request to a 8888 port. How do I do that with NGINX? In all examples of NGINX as a reverse proxy I see proxy_pass always defined to a specific u...
Your code appears to be using a forward proxy (often just "proxy"), not reverse proxy and they operate quite differently. Reverse proxy is for server end and something client doesn't really see or think about. It's to retrieve content from the backend servers and hand to the client. Forward proxy is something the clien...
NGINX
46,060,028
34
The Upstream server is wowza , which does not accept the custom headers if I don't enable them on application level. Nginx is working as a proxy server, from the browser I want to send few custom headers which should be received and logged by Nginx Proxy but before forwarding request to upstream server those headers s...
The proxy_set_header HEADER "" does exactly what you expect. See https://nginx.org/en/docs/http/ngx_http_proxy_module.html#proxy_set_header. If the value of a header field is an empty string then this field will not be passed to a proxied server: proxy_set_header Accept-Encoding ""; I have just confirmed this is work...
NGINX
44,536,548
34
I've installed Docker Toolbox in macOS and I'm following Docker's simple tutorial on deploying Nginx. I've executed docker run and confirmed that my container has been created: docker run --name mynginx1 -P -d nginx docker ps 40001fc50719 nginx "nginx -g 'daemon off" 23 minutes ago Up 23 minutes 0.0.0.0:32770->80/...
The issue is that your DOCKER_HOST is not set to localhost, you will need to use the IP address of your docker-machine, since you are using Docker Toolbox: docker-machine ip default # should return your IP address. See Docker Toolbox Docs for more information.
NGINX
33,022,250
34
I have a rails app in production that i deployed some changes to the other day. All of a sudden now I get the error ActiveRecord::ConnectionTimeoutError: could not obtain a database connection within 5.000 seconds (waited 5.000 seconds) multiple times a day and have to restart puma to fix the issue. I'm completely stum...
I had the same problems which were caused by too many open connections to the database. This can happen when you have database queries outside of a controller (in a model, mailer, pdf generator, ...). I could fix it by wrapping those queries in this block which closes the connection automatically. ActiveRecord::Base.co...
NGINX
27,801,185
34
Problem I have a rails 3.2.15 with rack 1.4.5 setup on two servers. First server is a nginx proxy serving static assets. Second server is a unicorn serving the rails app. In Rails production.log I always see the nginx IP address (10.0.10.150) and not my client IP address (10.0.10.62): Started GET "/" for 10.0.10.150 at...
In my opinion, your current approach is the only sane one. The only step that is missing is overwriting the IP address in env. The typical REMOTE_ADDR seldom holds the correct IP if you've any amount of layers of proxies and load balancers and what not -- you're not unique in this respect. Each potentially adds or chan...
NGINX
20,124,292
34
I have problem setting up CGI scripts to be run on Nginx, so far I've found http://wiki.nginx.org/SimpleCGI this stuff but problem is that I can't make perl script run as service so that it will run in background and even in case of restart it will start running automatically Do you have any idea? I'm running Centos 5 ...
Nginx doesn't have native CGI support (it supports fastCGI instead). The typical solution for this is to run your Perl script as a fastCGI process and edit the nginx config file to re-direct requests to the fastCGI process. This is quite a complex solution if all you want to do is run a CGI script. Do you have to use n...
NGINX
11,667,489
34
Need help on Nginx proxy_pass. From outside Nginx URL will be hit like this: http://some-IP:8080/v2/platform/general/activity/plan?..... my downstream service looks like this: http://another-IP:8080/activity/plan?... I want to get rid of /v2/platform/general from original public url and call my downstream service l...
proxy_pass and proxy_redirect have totally different functions. The proxy_redirect directive is only involved with changing the Location response header in a 3xx status message. See the NGINX proxy_redirect docs for details. Your rewrite statement does nothing other than prevent further modification of the URI. This li...
NGINX
59,852,217
33
I'm using nginx as a reverse proxy for my website. I want to be able to open my website in an iFrame from a chrome extension new tab html file. For this, I need my nginx to set X-Frame-Options to allow all domains. According to this answer, all domains is the default state if you don't set X-Frame-Options. My /etc/n...
Solved it by changing proxy_hide_header values in /etc/nginx/sites-available/default file like so: proxy_hide_header X-Frame-Options; Needed to restart nginx as well as use pm2 to restart my nodejs server (for some reason, it didn't work till I made a small change to my server and restarted it).
NGINX
47,405,597
33
I noticed my install of nginx has three folders called etc/nginx/sites-available etc/nginx/sites-enabled etc/nginx/conf.d Do I really need these if I just want to work directly in the etc/nginx/nginx.conf file and remove the include lines that include these items in nginx.conf? Are these directories used for anything ...
No, they are not needed if you define your server blocks properly in nginx.conf, but it's highly suggested. As you noticed, they are only used because of the include /etc/nginx/sites-enabled/*; in nginx.conf. For curiosity, is there a reason why you do not want to use them? They are very useful; easier to add new sites...
NGINX
41,303,885
33
I'm trying to set up NGINX and cloudflare. I've read about this on Google but nothing solved my problem. My cloudflare is active at the moment. I removed all page rules in cloudflare but before had domain.com and www.domain.com to use HTTPS. I thought this could be causing the problem so I removed it. Here is my defaul...
After tryouts I found that this is only related to Cloudflare. Because I had no redirect problem before moving to Cloudflare. In my case it was a simple fix like this. Select [Crypto] box and select Full (strict) as in the image. Really, you can try this out first before any other actions.
NGINX
35,143,193
33
I installed Gitlab CE on a dedicated Ubuntu 14.04 server edition with Omnibus package. Now I would want to install three other virtual hosts next to gitlab. Two are node.js web applications launched by a non-root user running on two distinct ports > 1024, the third is a PHP web application that need a web server to be...
About these But Omnibus listen 80 and doesn't seem to use neither Apache2 or Nginx [, thus ...]. and @stdob comment : Did omnibus not use nginx as a web server ??? – Wich I responded I guess not because nginx package isn't installed in the system ... In facts From Gitlab official docs : By default, omnibus-git...
NGINX
31,762,841
33
I have a vagrant box that has been working fine for sometime and today for some reason I get the following when I attemp to restart nginx. nginx: [emerg] host not found in upstream "www.myclass.com.192.168.33.10.xip.io" in /etc/nginx/conf.d/myclass.com.conf:19 nginx: configuration file /etc/nginx/nginx.conf test failed...
All you need is to put resolver that can resolve such domain name: resolver 8.8.8.8 valid=300s; resolver_timeout 10s; Google DNS (8.8.8.8) can resolve it, but it resolves to internal address belongs to network class C. $ dig @8.8.8.8 www.class.com.192.168.33.10.xip.io ;; ANSWER SECTION: www.c...
NGINX
26,585,510
33
I'm trying to log POST body, and add $request_body to the log_format in http clause, but the access_log command just prints "-" as the body after I send POST request using: curl -d name=xxxx myip/my_location My log_format (in http clause): log_format client '$remote_addr - $remote_user $request_time $upstream_respon...
Nginx doesn't parse the client request body unless it really needs to, so it usually does not fill the $request_body variable. The exceptions are when: it sends the request to a proxy, or a fastcgi server. So you really need to either add the proxy_pass or fastcgi_pass directives to your block. The easiest way is to ...
NGINX
17,609,472
33
I have the following nginx configuration fragment: server { listen 80; server_name mydomain.io; root /srv/www/domains/mydomain.io; index index.html index.php; access_log /var/log/nginx/domains/mydomain.io/access.log; error_log /var/log/nginx/domains/mydomain.io/error.log; location ~\.php { ...
According to https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/#server-name-if, you should use: server { server_name www.example.com; return 301 $scheme://example.com$request_uri; } server { server_name example.com; # [...] }
NGINX
11,323,735
33
I have a caching system I need to bypass if the user's name (in a cookie) is found in the $request_uri. I'm trying to do something like this, but can't get the variable to interpolate into the regex. Any suggestions pretty please? I can set the $me variable just fine from the cookie; I just can't get it to interpolate ...
It's not exactly what I asked, but I think it'll work for my purposes. I'm still curious how to interpolate a variable inside a nginx PCRE regex if anyone else knows! set $chk == "need"; set $me "kevin"; if ($uri ~ /by-([^-]+)/) { set $by $1; } if ($by = $me) {set $chk "";}
NGINX
5,859,848
33
I have a website running on a LEMP stack. I have enabled cloudflare with the website. I am using the cloudflare flexible SSL certificate for https. When i open the website in chrome it shows website redirected you too many times and in firefox has detected that the server is redirecting the request for this address in ...
Since you are using cloudflare flexible SSL your nginx config file wll look like this:- server { listen 80 default_server; listen [::]:80 default_server; server_name mydomain.com www.mydomain.com; if ($http_x_forwarded_proto = "http") { return 301 https://$server_name$request_uri; } root /var/www/ht...
NGINX
41,583,088
32
I want to parse all my logs of nginx (you can see here): ls /var/log/nginx/ access.log access.log.21.gz error.log.1 error.log.22.gz access.log.1 access.log.22.gz error.log.10.gz error.log.23.gz access.log.10.gz access.log.23.gz error.log.11.gz error.log.24.gz access.log.11.gz access.log.24.gz error...
Quoting the man page and assuming you have a Combined Log Format: If we would like to process all access.log.*.gz we can do one of the following: # zcat -f access.log* | goaccess --log-format=COMBINED OR # zcat access.log.*.gz | goaccess --log-format=COMBINED On Mac OS X, use gunzip -c instead of zcat.
NGINX
39,232,741
32
I am trying to reverse proxy my website and modify the content. To do so, I compiled nginx with sub_filter. It now accepts the sub_filter directive, but it does not work somehow. server { listen 8080; server_name www.xxx.com; access_log /var/log/nginx/www.goparts.access.log main; error_log /v...
Check if the upstream source has gzip turned on, if so you need proxy_set_header Accept-Encoding ""; so the whole thing would be something like location / { proxy_set_header Accept-Encoding ""; proxy_pass http://upstream.site/; sub_filter_types text/css; sub_filter_once off; sub_filter .upstream.si...
NGINX
31,893,211
32
I am trying to setup Nginx as a reverse proxy for accessing a MongoDB Database. By default Mongo listens to 27017 port. What I want to do, is redirect a hostname for example mongodb.mysite.com through nginx and pass it to mongodb server. In that way from the outside network I will have my known 27017 port closed, and ...
You're right, you need to use NGINX's stream module by adding a stream section to your .conf file: stream { server { listen <your incoming Mongo TCP port>; proxy_connect_timeout 1s; proxy_timeout 3s; proxy_pass stream_mongo_backend; } upstream stream_mongo_backend { ...
NGINX
31,853,755
32
Though I have done the following setting, and even restarted the server: # head /etc/security/limits.conf -n2 www-data soft nofile -1 www-data hard nofile -1 # /sbin/sysctl fs.file-max fs.file-max = 201558 The open files limitation of specific process is still 1024/4096: # ps aux | grep nginx root 983 0.0 0.0 ...
On CentOS (tested on 7.x): Create file /etc/systemd/system/nginx.service.d/override.conf with the following contents: [Service] LimitNOFILE=65536 Reload systemd daemon with: systemctl daemon-reload Add this to Nginx config file: worker_rlimit_nofile 16384; (has to be smaller or equal to LimitNOFILE set above) And fi...
NGINX
27,849,331
32
I want to insert log points (io.write) inside my lua code which itself is in nginx configuration (using HttpLuaModule for nginx). How to do that? Access and error logs are not showing them.
When running under nginx, you should use ngx.log. E.g: ngx.log(ngx.STDERR, 'your message here') For a working example, see http://linuxfiddle.net/f/77630edc-b851-487c-b2c8-aa6c9b858ebb For documentation, see http://wiki.nginx.org/HttpLuaModule#ngx.log
NGINX
26,189,429
32
Hello I have installed Gitlab using this https://gitlab.com/gitlab-org/omnibus-gitlab/blob/master/README.md#installation Now I want to use nginx to serve another content other than gitlab application how can I do this Where are the config files that I need to modify How can I point a directory like /var/www so that n...
Here I am using - gitlab.example.com to serve gitlab.example.com over https. - example.com over http to serve another content other than gitlab application. Gitlab installed from deb package is using chef to provision ngnix, so you have to modify chef recipies and add new vhost template into chef cookbooks directory ...
NGINX
24,090,624
32
I have a large URI and I am trying to configure Nginx to accept it. The URI parameters are 52000 characters in length with a size of 52kb. I have tried accessing the URI without Nginx and it works fine. But when I use Nginx it gives me an error. --- 414 (Request-URI Too Large) I have configured the large_client_header...
I have found the solution. The problem was that there were multiple instances of nginx running. This was causing a conflict and that's why the large_client_header_buffers wasnt working. After killing all nginx instances I restarted nginx with the configuration: client_header_buffer_size 64k; large_client_header_buffers...
NGINX
23,732,147
32
I'm trying to implement nginx rewrite rules for the following situation Request: http://192.168.64.76/Shep.ElicenseWeb/Public/OutputDocuments.ashx?uinz=12009718&iinbin=860610350635 Should be redirected to: http://localhost:82/Public/OutputDocuments.ashx?uinz=12009718&iinbin=860610350635 I tried this with no luck: l...
Your rewrite statement is wrong. The $1 on the right refers to a group (indicated by paratheses) in the matching section. Try: rewrite ^/Shep.ElicenseWeb/(.*) /$1 break;
NGINX
13,539,246
32
To respect the privacy of my users I'm trying to anonymize their IP addresses in nginx log files. One way to do this would be defining a custom log format, like so: log_format noip '127.0.0.1 - [$time_local] ' '"$request" $status $body_bytes_sent ' '"$http_referer" "$http_user_agent" $request_time'; This meth...
Even if there is already an accepted answer, the solution seems not to be valid. nginx has the log_format directive, which has a context of http. This means, the log_format can only be (valid) set within the http {} section of the config file, NOT within the server sections! On the other hand we have an if directive, w...
NGINX
6,477,239
32
I am currently running into a problem trying to set up nginx:alpine in Openshift. My build runs just fine but I am not able to deploy with permission being denied with the following error 2019/01/25 06:30:54 [emerg] 1#1: mkdir() "/var/cache/nginx/client_temp" failed (13: Permission denied) nginx: [emerg] mkdir() "/var...
I was using openshift, with limited permissions, so I fixed this problem by using the following nginx image (rather than nginx:latest) FROM nginxinc/nginx-unprivileged
NGINX
54,360,223
31
I have the following that config that works when I try <NodeIP>:30080 apiVersion: extensions/v1beta1 kind: Deployment metadata: name: app-deployment spec: replicas: 3 template: metadata: labels: name: app-node spec: containers: - name: app image: myregistry.net/repo/a...
Your ingress definition creates rules that proxy traffic from the {path} to the {backend.serviceName}{path}. In your case, I believe the reason it's not working is that /app is proxied to app-service:80/app but you're intending on serving traffic at the / root. Try adding this annotation to your ingress resource: nginx...
NGINX
52,021,925
31
I've a simple kubernetes ingress network. I need deny the access some critical paths like /admin or etc. My ingress network file shown as below. apiVersion: extensions/v1beta1 kind: Ingress metadata: name: ingress-test spec: rules: - host: host.host.com http: paths: - path: /service-mapping ...
You can use server-snippet annotation. This seems like exactly what you want to achieve.
NGINX
51,874,503
31
Google Cloud Network load balancer is a pass-through load balancer and not a proxy load balancer. ( https://cloud.google.com/compute/docs/load-balancing/network/ ). I can not find any resources in general on a pass through LB. Both HAProxy and Nginx seems to be proxy LBs. I'm guessing that pass through LB would be red...
It's hard to find resources for pass-through load balancing because everyone came up with a different way of calling it: pass-though, direct server return(DSR), direct routing,... We'll call it pass-through here. Let me try to explain the thing: The IP packets are forwarded unmodified to the VM, there is no address or...
NGINX
43,205,917
31
How can I pass the nginx.conf configuration file to an nginx instance running inside a Kubernetes cluster?
You can create a ConfigMap object and then mount the values as files where you need them: apiVersion: v1 kind: ConfigMap metadata: name: nginx-config data: nginx.conf: | your config comes here like this other.conf: | second file contents And in you pod spec: spec: containers: - name: ng...
NGINX
42,078,080
31
I have a web-service that runs long-running jobs (in the order of several hours). I am developing this using Flask, Gunicorn, and nginx. What I am thinking of doing is to have the route which takes a long time to complete, call a function that creates a thread. The function will then return a guid back to the route, an...
Celery and RQ is overengineering for simple task. Take a look at this docs - https://docs.python.org/3/library/concurrent.futures.html Also check example, how to run long-running jobs in background for Flask app - https://stackoverflow.com/a/39008301/5569578
NGINX
34,321,986
31
I have precisely the same problem described in this SO question and answer. The answer to that question is a nice work around but I don't understand the fundamental problem. Terminating SSL at the load balancer and using HTTP between the load balancer and web/app servers is very common. What piece of the stack is not r...
You are missing the ProxyFix() middleware component. See the Flask Proxy Setups documentation. There is no need to subclass anything; simply add this middleware component to your WSGI stack: # Werkzeug 0.15 and newer from werkzeug.middleware.proxy_fix import ProxyFix from flask import Flask app = Flask(__name__) app....
NGINX
23,347,387
31
I want any requests like http://example.com/whatever/index.php, to do a 301 redirect to http://example.com/whatever/. I tried adding: rewrite ^(.*/)index.php$ $1 permanent; location / { index index.php; } The problem here, this rewrite gets run on the root url, which causes a infinite redirect loop. Edit: I...
Great question, with the solution similar to another one I've answered on ServerFault recently, although it's much simpler here, and you know exactly what you need. What you want here is to only perform the redirect when the user explicitly requests /index.php, but never redirect any of the internal requests that end u...
NGINX
21,687,288
31
I use nginx as a load balencer in front of several tomcats. In my incoming requests, I have encoded query parameters. But when the request arrives to tomcat, parameters are decoded : incoming request to nginx: curl -i "http://server/1.1/json/T;cID=1234;pID=1200;rF=http%3A%2F%2Fwww.google.com%2F" incoming request to to...
I finally found the solution: I need to pass $request_uri parameter : location / { proxy_pass http://tracking/webapp$request_uri; } That way, characters that were encoded in the original request will not be decoded, i.e. will be passed as-is to the proxied server.
NGINX
20,496,963
31
I have a django app, python 2.7 with gunicorn and nginx. Nginx is throwing a 403 Forbidden Error, if I try to view anything in my static folder @: /home/ubuntu/virtualenv/myapp/myapp/homelaunch/static nginx config(/etc/nginx/sites-enabled/myapp) contains: server { listen 80; server_name *.mya...
MacOs El Capitan: At the top of nginx.conf write user username group_name My user name is Kamil so i write: user Kamil staff; (word 'staff' is very important in macOS). This do the trick. After that you don't need to change any permission in your project folder and files.
NGINX
20,182,329
31
I want to use rewrite function in my nginx server. When I try "http://www.example.com/1234", I want to rewrite "http://www.example.com/v.php?id=1234" and want to get "http://www.example.com/1234" in browser. Here is nginx.conf file ... location ~ /[0-9]+ { rewrite "/([0-9]+)" http://www.example.com/v.php?id=$1 ...
Reference: http://wiki.nginx.org/HttpRewriteModule#rewrite If the replacement string begins with http:// then the client will be redirected, and any further >rewrite directives are terminated. So remove the http:// part and it should work: location ~ /[0-9]+ { rewrite "/([0-9]+)" /v.php?id=$1 break; }
NGINX
15,322,826
31
I'm rewriting URLs in nginx after a relaunch. In the old site I had query parameters in the URL to filter stuff e.g. http://www.example.com/mypage.php?type=4 The new page doesn't have these kind of parameters. I want to remove them and rewrite the URLs to the main page, so that I get: http://www.example.com/mypage/ M...
Had a similar problem, after a lot of searching the answer presented itself in the rewrite docs. If you specify a ? at the end of a rewrite then Nginx will drop the original $args (arguments) So for your example, this would do the trick: location ^~ /mypage.php { rewrite ^/mypage.php$ http://www.example.com/mypag...
NGINX
9,641,603
31
I have a django application running on http://localhost:12345 . I'd like user to access it via url http://my.server.com/myapp . I use nginx to reverse proxy to it like the following: ... ... server_name my.server.com; location /myapp { rewrite /myapp(.*) $1 break; ... ... # proxy param proxy_pass h...
As the prefix is set in Nginx, the web server that hosts the Django app has no way of knowing the URL prefix. As orzel said, if you used apache+mod_wsgi of even nginx+gunicorn/uwsgi (with some additional configuration), you could use the WSGIScriptAlias value, that is automatically read by Django. When I need to use a ...
NGINX
8,133,063
31
Rails 3.1 has a convenient system which can compress files into .gz files. However, instead what I've done is I've moved all the asset files that are created with assets:precompile to a static webserver. This all works, but how can I get nginx to serve the .gz files normally?
1) ensure you have Nginx > 1.2.x (to proper headers modifications) and compile with --with-http_gzip_static_module option 2) Enable this option gzip on (to serve back-end response with gzip header) 3) Setup assets location with gzip_static on (to serve all.css.gz, all.js.gz files directly) 4) Prevent of etag generation...
NGINX
6,952,639
31
Is it possible to echo each time the loop is executed? For example: foreach(range(1,9) as $n){ echo $n."\n"; sleep(1); } Instead of printing everything when the loop is finished, I'd like to see it printing each result per time.
The easiest way to eliminate nginx's buffering is by emitting a header: header('X-Accel-Buffering: no'); This eliminates both proxy_buffering and (if you have nginx >= 1.5.6), fastcgi_buffering. The fastcgi bit is crucial if you're using php-fpm. The header is also far more convenient to do on an as-needed basis. Docs...
NGINX
4,870,697
31
From what I understand Node.js doesnt need NginX to work as a http server (or a websockets server or any server for that matter), but I keep reading about how to use NginX instead of Node.js internal server and cant find of a good reason to go that way
Here http://developer.yahoo.com/yui/theater/video.php?v=dahl-node Node.js author says that Node.js is still in development and so there may be security issues that NginX simply hides. On the other hand, in case of a heavy traffic NginX will be able to split the job between many Node.js running servers.
NGINX
3,186,333
31
I am using file_put_contents to create a file. My php process is running in a group with permissions to write to the directory. When file_put_contents is called, however, the resulting file does not have group write permissions (it creates just fine the first time). This means that if I try to overwrite the file it fai...
Example 1 (set file-permissions to read-write for owner and group, and read for others): file_put_contents($filename, $data); chmod($filename, 0664); Example 2 (make file writable by group without changing other permissions): file_put_contents($filename, $data); chmod($filename, fileperms($filename) | 16); Example 3 ...
NGINX
1,240,034
31
I am trying to configure nginx server for my website. I am using the following code to configure my server. It works if I add default_server for my www.fastenglishacademy.fr (443) server block. But in that case, All my subdomains also brings the content of www.fastenglishacademy.fr And if I remove the default_server, I...
Your server section is missing ssl_certificate and ssl_certificate_key declarations. You need to have a .crt and a .key file to run with ssl. It should looks like server { listen 80; listen 443 default_server ssl; ssl_certificate /etc/nginx/certs/default.crt; ssl_certificate_key /etc/nginx/certs/default.key; ...
NGINX
56,668,320
30
I am trying to start an NGINX server within a docker container configured through docker-compose. The catch is, however, that I would like to substitute an environment variable inside of the http section, specifically within the "upstream" block. It would be awesome to have this working, because I have several other c...
Since nginx 1.19 you can now use environment variables in your configuration with docker-compose. I used the following setup: # file: docker/nginx/templates/default.conf.conf upstream api-upstream { server ${API_HOST}; } # file: docker-compose.yml services: nginx: image: nginx:1.19-alpine vol...
NGINX
56,649,582
30
My configuration file has a server directive block that begins with... server { server_name www.example1.com www.example2.com www.example3.com; ...in order to allow the site to be accessed with different domain names. However PHP's $_SERVER['SERVER_NAME'] always returns the first entry of server_name, in this case...
Set SERVER_NAME to use $host in your fastcgi_params configuration. fastcgi_param SERVER_NAME $host; Source: http://nginx.org/en/docs/http/ngx_http_fastcgi_module.html#fastcgi_param
NGINX
31,479,341
30
I found strange behaviour concerning php and /tmp folder. Php uses another folder when it works with /tmp. Php 5.6.7, nginx, php-fpm. I execute the same script in two ways: via browser and via shell. But when it is launched via browser, file is not in real /tmp folder: <?php $name = date("His"); echo "File /tmp/$name...
Because systemd is configured to give nginx a private /tmp. If you must use the system /tmp instead for some reason then you will need to modify the .service file to read "PrivateTmp=no".
NGINX
30,444,914
30
I know that there are a lot of questions like this on SO, but none of them appear to answer my particular issue. I understand that Django's ALLOWED_HOSTS value is blocking any requests to port 80 at my IP that do not come with the appropriate Host: value, and that when a request comes in that doesn't have the right va...
Seems like proxy_set_header Host $http_host should be changed to proxy_set_header Host $host and server_name should be set appropriately to the address used to access the server. If you want it to catch all, you should use server_name www.domainname.com "" (doc here). I'm not certain, but I think what you're seeing h...
NGINX
25,370,868
30
Recently I have started using NGINX, I found that we can use it for reverse proxy, serving static content from itself which can reduce load time. I have a Tomcat/JBoss server on my local machine and I want to put NGINX in front of it so that static content will be served from NGINX and rest all by Tomcat/JBoss. My Tomc...
You can add location with regexp: server { listen 80; server_name localhost; location ~* \.(js|jpg|png|css)$ { root path/to/tomcat/document/root/Test/; expires 30d; } location / { proxy_pass http://127.0.0.1:8081/Test/; } }
NGINX
23,776,660
30
I am reading nginx beginner's tutorial, on the section Serving Static Content they have http { server { } } but when I add an http block I get the error [emerg] "http" directive is not allowed here … When I remove the http block and change the conf file to this, it works fine: server { listen 80 default_ser...
Your doing fine. I guess you are editing /etc/nginx/sites-enabled/default (or the linked file at /etc/nginx/sites-available/default. This is the standard nginx set up. It is configured with /etc/nginx/nginx.conf which contains the http {} statement. This in turn contains an "include /etc/nginx/sites-enabled/*" line t...
NGINX
20,639,568
30
tl;dr version How do you setup nginx as a reverse proxy for example.com to a locally running tomcat webapp at http://127.0.0.1:8080/blah/ without breaking the pageContext? Tomcat Setup There exists a tomcat 7 webapp, blah, deployed with a .war file and sitting in /var/lib/tomcat7/webapps/blah/. tomcat is running loca...
One possible solution is to create a virtual host within tomcat and set blah as the ROOT app on the new host. nginx will pass still pass requests to tomcat on localhost including the requested host header and tomcat will handle the rest with the correct context. Setup the Virtual host Add a Host entry to the Engine po...
NGINX
19,866,203
30
I've been using nginx for a few months without issue, but after upgrading to Mac OS X 10.9 Mavericks, when trying to start nginx I get this: nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80 failed (48: Address already in use) nginx: [emerg] bind() to 0.0.0.0:80...
Your ps ... | egrep command is finding itself, not an instance of nginx (look at the "COMMAND" column). Since port 80 is in use, it's likely some other program (maybe the Apache that comes with the OS?) is running and grabbing it. To find out, run: sudo lsof -i:80 If it's the system Apache ("httpd") program, you can p...
NGINX
19,720,237
30
I am really new to sys admin stuff, and have only provisioned a VPS with nginx(serving the static files) and gunicorn as the web server. I have lately been reading about different other stuff. I came to know about other tools: nginx : high-performance HTTP server and reverse proxy, as well as an IMAP/POP3 proxy server...
Let's say you plan to host a few websites on your new VPS. Let's look at the tools you might need for each site. HTTP Servers Website 'Alpha' just consists of a some pure HTML, CSS and Javascript. The content is static. When someone visits website Alpha, their browser will issue an HTTP request. You have configured (...
NGINX
13,210,636
30
I'm trying to set up Nginx on my Windows development environment. I can't find how to create something similar to "sites-enabled" on Linux where Nginx would look for (links to) active virtual host configurations. Is there a way to do something similar with a directory with shortcuts to the actual configuration files a...
In windows you have to give full path of the directory where the config files are located. There are two files to update: nginx.conf, which tells nginx where to find web sites, and localhost.conf, which is the configuration for a web site. It is assumed that nginx is installed in C:\nginx. If the installation directory...
NGINX
13,070,986
30
Sometimes I get an issue with error 502 when httpd service is down. But only in 1 minute the website come back. I need to custom the 502 message to ask user to wait for 1 minute then refresh page, or embed JavaScript or meta refresh tag to auto refresh page after 1 minute. Page's URL must be the same to make refresh ef...
I found an answer that works for me. In the vhost config file, I put right at the end of the server block, before closing brace: error_page 502 /502.html; location = /502.html { root /home/xaluano/public_html; } Of course I also need to create a file 502.html at my domain root, with the meta-tag refresh...
NGINX
10,895,071
30
I have nginx running on my server, listening port 80 and 433. I know nginx has a number ways of port forwarding that allows me to forward request like: http://myserver:80/subdir1 to some address like: http://myserver:8888. My question is it possible to configure nginx so that i can forward NON-http request (just those ...
It is possible since nginx 1.9.0: http://nginx.org/en/docs/stream/ngx_stream_core_module.html Something along these lines (this goes on top level of nginx.conf): stream { upstream backend { server backend1.example.com:12345; } server { listen 12345; proxy_pass backend; } }
NGINX
5,337,122
30
I'm vaguely aware that on a computer joined to a domain IE can be asked to send some extra headers that I could use to automatically sign on to an application. I've got apache running on a windows server with mod_php. I'd like to be able to avoid the user having to log in if necessary. I've found some links talking abo...
All you need is the mod_auth_sspi Apache module. Sample configuration: AuthType SSPI SSPIAuth On SSPIAuthoritative On SSPIDomain mydomain # Set this if you want to allow access with clients that do not support NTLM, or via proxy from outside. Don't forget to require SSL in this case! SSPIOfferBasic On # Set this if ...
NGINX
1,003,751
30
I need your help to understand my problem. I updated my macintosh with Catalina last week, then i updated docker for mac. Since those updates, i have ownership issues on shared volumes. I can reproduce with a small example. I just create a small docker-compose which build a nginx container. I have a folder src with a ...
If it was working prior to the update to Catalina, the issue is due to the new permissions requested by Catalina. Now, macOS requests permissions for everything, even for accessing a directory. So, probably you had a notification about granting Docker for Mac permission to access the shared folder, you didn't grant it,...
NGINX
58,482,352
29
I'm trying to add SSL certs (generated with LetsEncrypt) to my nginx. The nginx is built from a docker-compose file where I create a volume from my host to the container so the containers can access the certs and private key. volumes: - /etc/nginx/certs/:/etc/nginx/certs/ When the nginx container starts and fails wi...
Finally cracked this and was able to successfully repeat the process on my dev and production site to get SSL certs working! Sorry for the length of the post! In my setup I have docker docker-compose setup on an ubuntu 16 machine. Anyone who's encountering this problem I'll detail the steps I did. Go to the directory ...
NGINX
51,399,883
29
I've set up two web applications in my DigitalOcean droplet, and I'm trying to run both applications on different domains, with SSL encryption. I can confirm that everything works if I only use one of the domains, and the error occurs when I try to run both at the same time. nginx -t duplicate listen options for [::]:4...
The problem is ipv6only=on, which can only be specified once according to the documentation. The default value is on anyway, so the option can be safely removed.
NGINX
49,938,342
29
Recently, I upgrade one of my django sites from http to https. However, after that, I continuously receive Invalid HTTP_HOST header error email while before I never received such type of emails. Here are some log messages: [Django] ERROR (EXTERNAL IP): Invalid HTTP_HOST header: '123.56.221.107'. You may need to add '1...
Disabling DisallowedHost host warnings as suggested in the other answer is not the correct solution in my opinion. There is a reason why Django gives you those warnings - and it is better for you to block those requests before they reach Django. You created a new server block in your nginx configuration. Because it is ...
NGINX
47,846,521
29
lets say I've a path like: /var/www/myside/ that path contains two folders... let's say /static and /manage I'd like to configure nginx to have an access to: /static folder on / (eg. http://example.org/) this folder has some .html files. /manage folder on /manage (eg. http://example.org/manage) in this case this folde...
To access a path like /var/www/mysite/manage/public with a URI like /manage, you will need to use alias rather than root. See this document for details. I am assuming that you need to run PHP from both roots, in which case you will need two location ~ \.php blocks, see example below. If you have no PHP within /var/www/...
NGINX
42,443,468
29
Should I leave the /.well-known/acme-challenge always exposed on the server? Here is my config for the HTTP: server { listen 80; location '/.well-known/acme-challenge' { root /var/www/demo; } location / { if ($scheme = http) { return 301 https://$server_name$request_uri; ...
Acme challenge link only needed for verifying domain to this ip address
NGINX
41,803,140
29