You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+2-2
Original file line number
Diff line number
Diff line change
@@ -11,10 +11,10 @@
11
11
### Contributing
12
12
13
13
1. Fork this repo and make changes in your own fork.
14
-
2. Commit your changes and push to your fork `git push origin master`
14
+
2. Commit your changes and push to your fork `git push origin main`
15
15
3. Create a new pull request and submit it back to the project.
16
16
17
17
18
18
### Bugs & Issues
19
19
20
-
To report bugs (or any other issues), use the [issues page](https://github.com/Wanekeya/safe-secure-password-generator/issues).
20
+
To report bugs (or any other issues), use the [issues page](https://github.com/SamWanekeya/dockerizing-react-js-with-nginx-and-self-signed-ssl-certificate/issues).
# This value auto allows binding worker processes automatically to available CPU
2
+
# This value auto allows binding worker processes automatically to available CPUs
4
3
worker_processes auto;
5
4
# Allows binding worker processes automatically to available CPUs
6
5
worker_cpu_affinity auto;
7
-
# The number of simultaneous connections is limited by the number of file descriptors available on the system as each socket will open a file descriptor. If NGINX tries to open more sockets than the available file descriptors, it will lead to the Too many opened files message in the error.log.
6
+
# The number of simultaneous connections is limited by the number of file descriptors available on the system as each socket will open a file descriptor. If NGINX tries to open more sockets than the available file descriptors, it will lead to the too many opened files message in the error.log.
8
7
worker_rlimit_nofile65535;
9
-
10
-
# logging
8
+
# error logging
11
9
error_log /var/log/nginx/error.log;
10
+
# log warning errors
12
11
error_log /var/log/nginx/error.log warn;
13
-
error_log /var/log/nginx/error.log notice;
14
-
error_log /var/log/nginx/error.log info;
12
+
# log notice errors
13
+
error_log /var/log/nginx/error.log notice;
14
+
# log info errors
15
+
error_log /var/log/nginx/error.log info;
16
+
# log critical errors
17
+
error_log /var/log/nginx/error.log crit;
15
18
16
19
pid /var/run/nginx.pid;
17
20
@@ -32,15 +35,37 @@ events {
32
35
}
33
36
34
37
http {
38
+
# cache informations about FDs, frequently accessed files
39
+
# can boost performance, but you need to test those values
40
+
# This directive is disabled by default. Enable it if you want implement caching in Nginx. This directive stores metadata of files and directories commonly requested by users.
41
+
open_file_cache max=200000 inactive=20s;
42
+
# This directive contains backup information inside the open_file_cache directive. You can use this directive to set a valid period usually in seconds after which the information related to files and directories is re-validated again.
43
+
open_file_cache_valid30s;
44
+
# Nginx usually clear information inside the open_file_cache directive after a period of inactivity based on the open_file_cache_min_uses. You can use this directive to set a minimum number of access to identify which files and directories are actively accessed.
45
+
open_file_cache_min_uses4;
46
+
# You can make use of this directive to allow Nginx to cache errors such as “permission denied” or “can’t access this file” when files are accessed. So anytime a resource is accessed by a user who does not have the right to do so, Nginx displays the same error report “permission denied”.
47
+
open_file_cache_errors on;
35
48
# To support larger number of server names that are defined
36
49
server_names_hash_bucket_size64;
37
50
# Sets the bucket size for the server names hash tables. The default value depends on the size of the processor’s cache line.
38
51
server_names_hash_max_size512;
52
+
log_format upstreamlog '$server_name to: $upstream_addr [$request] '
53
+
'upstream_response_time $upstream_response_time '
54
+
'msec $msec response_time $request_time ';
55
+
56
+
upstreamreactapp_service {
57
+
# Load balancing method
58
+
least_conn;
59
+
# Defines a shared memory zone with the zone directive
60
+
zone reactapp_service 64k;
61
+
server reactapp_svc weight=10 max_fails=10 fail_timeout=60;
62
+
}
63
+
39
64
# redirect all http traffic to https
40
65
server {
41
66
listen80 default_server;
42
67
listen [::]:80 default_server ipv6only=on;
43
-
server_name samwanekeya.com;
68
+
server_name*.samwanekeya.com *.samwanekeya.co.ke;
44
69
root /usr/share/nginx/html;
45
70
index index.html index.htm index.nginx-debian.html;
46
71
return301 https://$host$request_uri;
@@ -49,13 +74,13 @@ http {
49
74
server {
50
75
listen443 ssl;
51
76
listen [::]:443 ssl ipv6only=on;
52
-
server_name samwanekeya.com;
77
+
server_name*.samwanekeya.com *.samwanekeya.co.ke;
53
78
# MIME
54
79
include /etc/nginx/mime.types;
55
80
default_type application/octet-stream;
56
81
# Display nginx Version number in error or http header may result in hacker to search for known vulnerability. Therefore, the version number should be removed for every http response.
57
-
server_tokens"off";
58
-
#charset utf-8;
82
+
server_tokens off;
83
+
charset utf-8;
59
84
# This directive, by default, is disabled to allow small packets to wait for a specified period before they are sent at once. To allow all data to be sent at once, this directive is enabled.
60
85
tcp_nodelay on;
61
86
# Because we have enabled tcp_nodelay directive, small packets are sent at once. However, if you still want to make use of John Nagle’s buffering algorithm, we can also enable the tcp_nopush to add packets to each other and send them all at once.
@@ -82,17 +107,18 @@ http {
82
107
#keepalive_disable;
83
108
#Sets a timeout for transmitting a response to the client. The timeout is set only between two successive write operations, not for the transmission of the whole response. If the client does not receive anything within this time, the connection is closed.
# Deny access to hidden files (beginning with a period)
30
-
location ~ /\. {
31
-
deny all;
32
-
error_log off;
33
-
log_not_found off;
34
-
}
35
-
36
-
37
17
location /video/ {
38
18
# To utilize operating system resources, set the value of this directive to on. sendfile transfers data between file descriptors within the OS kernel space without sending it to the application buffers. This directive will be used to serve small files.
39
19
sendfile on;
@@ -88,12 +68,3 @@ if ($host !~ ^(samwanekeya.com|localhost)$ ) {
88
68
#gzip_vary on;
89
69
# Some browsers such as Internet Explorer 6 do not have support for gzip compression. This directive make use of User-Agent request header field to disable compression for certain browsers.
90
70
#gzip_disable "MSIE [4-6] \.";
91
-
92
-
# This directive is disabled by default. Enable it if you want implement caching in Nginx. This directive stores metadata of files and directories commonly requested by users.
93
-
open_file_cache max=1000 inactive=30s;
94
-
# This directive contains backup information inside the open_file_cache directive. You can use this directive to set a valid period usually in seconds after which the information related to files and directories is re-validated again.
95
-
open_file_cache_valid 30s;
96
-
# Nginx usually clear information inside the open_file_cache directive after a period of inactivity based on the open_file_cache_min_uses. You can use this directive to set a minimum number of access to identify which files and directories are actively accessed.
97
-
open_file_cache_min_uses 4;
98
-
# You can make use of this directive to allow Nginx to cache errors such as “permission denied” or “can’t access this file” when files are accessed. So anytime a resource is accessed by a user who does not have the right to do so, Nginx displays the same error report “permission denied”.
0 commit comments