Removing any text after .html in url

I have following rewrite rules for nginx. rewrite ^/(.*)/(.*)/(.*).html$ /index.php?first=$1&second=$2&third=$3 last; rewrite ^/(.*)/(.*).html$ /index.php?first=$1&second=$2 last; rewrite ^/(.*).html$ /index.php?first=$1 last; They wo...
more »

2017-11-29 20:11 (0) Answers

Cannot install ngx_mruby on Centos 7

I want to install nginx with the module ngx_mruby on centos7, but I ran into the compilation errors. Following the steps described here, I did (in my home directory): wget http://nginx.org/download/nginx-1.10.1.tar.gz tar zxvf nginx-1.10.1.tar.gz g...
more »

2017-11-25 14:11 (0) Answers

nginx friendly url

I am new with NGINX and I would like to create a friendly URL. my current URL: /post.php?url=name-of-the-post I would like my URL to looks like this: /post/name-of-the-post I am newbie with regex etc, could anyone help me? ...
more »

2017-11-19 20:11 (0) Answers

Django+gunicorn+nginx telegram webhook ssl trouble

I was trying to setup a django as webhooks for telegram bots. I create a ssl cert's using this commands: openssl genrsa -out webhook_pkey.pem 2048 openssl req -new -x509 -days 3650 -key webhook_pkey.pem -out webhook_cert.pem # In Common Name i type ...
more »

2017-10-26 18:10 (1) Answers

How do I deploy Django app to (AWS) domain name?

I've only been working with Django for a few weeks, and just learned deployment. I have an AWS EC2 Instance, which I'm able to deploy my Django website/app to (i.e., if I go to the IP address in my browser, I'm able to access my website). However, I ...
more »

2017-10-14 08:10 (2) Answers

Using vary: user-agent in http response header

I came across this post (5 years old) https://www.merkleinc.com/blog/vary-user-agent-http-header-broken explaining the problem with user-agent. They are basically saying that "user-agent" strings keeps on changing and ISP/CDN will end up storing m...
more »

2017-10-12 02:10 (0) Answers

Gogs installation Error

Environment OS : Centos7 Panel : VestaCP (Nginx). Domain : my.exgitrepo.com(locally) IP : 192.168.1.13(locally) User: admin In my /home/admin/my.exgitrepo.com/public_html/ i downloaded gogs binary, unzip it and run ./gogs web Filled up forms on ...
more »

2017-10-07 14:10 (1) Answers

Using pdb with supervisor

I am running my django app using docker compose. Ngninx and gunicorn are run via supervisor. However I can't seem to figure out how to debug using pdb. When I use: import pdb pdb.set_trace() After running the command docker-compose up, my app an...
more »

2017-09-30 14:09 (1) Answers

Nginx gateway timeout without much load on server

I am using NGINX and UWSGI to power the python/Django based API backend with load balancer attached to AWS auto scale groups, my servers works fine in routine, but sometimes start getting 504 or 502 from server once in a month or two constantly for...
more »

2017-09-21 09:09 (2) Answers

Combining logs from a cluster architecture

I've been looking for solutions to combine logs from a load balanced architecture so that I could effectively debug a server error or an access log. As of now I need to check each web node individually. Any out of the box solutions would be nice. ...
more »

2017-09-12 21:09 (1) Answers

Conditional url rewrite and proxy

I have a Javascript app, and for Social Sharing puposes I would like to return the result form another server when the facebook crawler visits the page. Basically, if I detect a Social bot, I would like to do: GET https://example.net/shared/route/1...
more »

2017-08-28 17:08 (0) Answers

502 Bad Gateway Nginx after server restore

So I've got a Ubuntu server that I'm trying to restore from a backup. And when a dummy PHP version page I get 502 Bad Gateway. What have I tried to fix it? Quite a few things including the answers from this related question - nginx 502 bad gateway T...
more »

2017-08-11 19:08 (3) Answers

Heroku - bundler: failed to load command: unicorn

Ruby 2.3.1 Rails 5.1.2 Been trying to deploy my rails app into heroku by setting its multi buildpack (heroku buildpacks:set https://github.com/heroku/heroku-buildpack-multi.git) with https://github.com/heroku/heroku-buildpack-ruby.git and https://g...
more »

2017-08-11 02:08 (1) Answers

Transfer Zend App to new VPS show blank page

I bought a new VPS and I try to transfer my working ZendApp (work in previous hosting with DirectAdmin). Now i install nginx with php5 and mysql i this is my php configuration - works well http://178.216.200.85/info.php I turn on display errors in ...
more »

2017-07-27 10:07 (1) Answers

Two document roots with nginx and fastcgi

I am using nginx and php in a docker-environment, which works fine for a single application. Now I want to develop an application based in yii2/php as backend and angular as frontend, so I need one webserver serving the client, and another one servin...
more »

2017-07-11 13:07 (1) Answers