Mar 19

Solved – nginx could not build the server_names_hash

In Nginx environment, you may be experienced following error message saying you should have to increase server_names_hash_bucket_size.

 

Error!

Error message:-  nginx: [emerg] could not build the server_names_hash, you should increase server_names_hash_bucket_size: 32
nginx: configuration file /etc/nginx/nginx.conf test failed.  

 

This error is due to using large server_name which does not fit in the hash bucket. It is recommended to use small values as where as possible, because it can directly impact the web server performance as server_name is being looked up on every request. you can find setting up hashes from here.

Solution :- Add following line to nginx.conf
server_names_hash_bucket_size 64;

then test the nginx config, if it is success you can reload / restart Nginx.
#sudo nginx -t
#sudo nginx reload

Mar 17

How to turn Cisco router into a host or PC

Cisco IOS emulators such GNS3, Cisco IOU are widely used to practicing CCNP, CCIE exam. Those emulators do not have built in features to emulate PC. This article demonstrates how to make PC / host from Cisco router to fulfill emulation requirements.

Following is the my PC / host network interface ip address and default gateway. You might need to adjust it as you required. So let’s look at how to turn Cisco router into a host.
interface :- fa0/0
interface ip :- 10.0.1.1/30
host default gateway :- 10.0.1.2/30

Router>enable
Router#configure terminal

! Disable ip routing function of the router
Router(config)#no ip routing

! Assuming host  interface as fa0/0 , configure it's ip address (host ip address) and subnet mask
Router(config)#interface fa0/0
Router(config-if)# ip address 10.1.1.1 255.255.255.252
Router(config-if)#no shutdown
Router(config-if)#exit

!set default gateway
Router(config)#ip default-gateway 10.0.1.2

Don’t forget to copy running-configuration into startup-configuration. Further, to identify this device as host / PC quickly, give meaningful host name such as PC-1 for an example.

Mar 17

Redirect http to https nginx

This is most effective method of redirecting web traffic to SSL in Nginx web server. According to Nginx documentation, they do not recommend to use ‘rewrite’ directive, instead advised to use ‘return’ directive. The guidelines regarding Nginx directive can be found at official Nginx document . So let’s look at how to redirect http to https Nginx .

1) Open Nginx config file of virtual host.

ex:- sudo vim /etc/nginx/sites-available/yourdomain.com

2) Insert following code snipet.

server {
       listen         80;
       server_name    yourdomain.com;
       return         301 https://$server_name$request_uri;
}

server {
       listen         443 ssl;
       server_name    yourdomain.com;
       #rest of the configuration code goes in here.
}

Nginx ssl redirecting configuration is completed. comment here if you have any question at all.

Older posts «

» Newer posts

Fetch more items