Menu
Forums
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Trending
What's new
New posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Search profile posts
Upgrades
Log in
Register
What's new
Search
Search
Search titles only
By:
All threads
Latest threads
New posts
Trending threads
New posts
Search forums
Menu
Log in
Register
Navigation
Install the app
Install
More options
Contact us
Close Menu
Forums
Server Development
Habbo Retros
Habbo Q&A
Nginx for Brain Cms
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Brunx2it" data-source="post: 469647" data-attributes="member: 101786"><p>Hi, I tried to configure Nginx with Braincms but apparently I couldn’t because it gives me 404 error:</p><p>[CODE]2021/06/14 12:35:07 [error] 7180#6020: *1 connect() failed (10061: Unable to establish connection. Persistent rejection of target computer) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"[/CODE]</p><p></p><p>This is how I tried to configure, I don’t know if it’s even remotely right:</p><p>[CODE]#user nobody;</p><p>worker_processes 1;</p><p></p><p>#error_log logs/error.log;</p><p>#error_log logs/error.log notice;</p><p>#error_log logs/error.log info;</p><p></p><p>#pid logs/nginx.pid;</p><p></p><p></p><p>events {</p><p> worker_connections 1024;</p><p>}</p><p></p><p></p><p>http {</p><p> include mime.types;</p><p> default_type application/octet-stream;</p><p></p><p> #log_format main '$remote_addr - $remote_user [$time_local] "$request" '</p><p> # '$status $body_bytes_sent "$http_referer" '</p><p> # '"$http_user_agent" "$http_x_forwarded_for"';</p><p></p><p> #access_log logs/access.log main;</p><p></p><p> sendfile on;</p><p> #tcp_nopush on;</p><p></p><p> #keepalive_timeout 0;</p><p> keepalive_timeout 65;</p><p></p><p> #gzip on;</p><p></p><p> server {</p><p> listen 80;</p><p> server_name localhost;</p><p></p><p> #charset koi8-r;</p><p></p><p> #access_log logs/host.access.log main;</p><p></p><p>location / {</p><p>root html;</p><p>index index.php;</p><p> rewrite ^/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=$1;</p><p>}</p><p></p><p>location /news {</p><p> rewrite ^/news/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=news&id=$1;</p><p>}</p><p></p><p>location /home {</p><p> rewrite ^/home/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=home&user=$1;</p><p>}</p><p></p><p>location /swf {</p><p> rewrite ^/swf/habbo-imaging/badge/([a-zA-Z0-9_-]+)(|/)$ /swf/habbo-imaging/badge.php?badge=$1;</p><p>}</p><p></p><p>location /register {</p><p> rewrite ^/register/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=register&userref=$1;</p><p>}</p><p></p><p>location /newpassword {</p><p> rewrite ^/newpassword/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=newpassword&key=$1;</p><p>}</p><p></p><p></p><p></p><p></p><p></p><p> location /.htaccess {</p><p> deny all;</p><p> }</p><p></p><p> location ~ “\.(tpl,sql)$” {</p><p> deny all;</p><p> }</p><p></p><p> location /403.shtml {</p><p> allow all;</p><p> }</p><p></p><p> #error_page 404 /404.html;</p><p></p><p> # redirect server error pages to the static page /50x.html</p><p> #</p><p> error_page 500 502 503 504 /50x.html;</p><p> location = /50x.html {</p><p> root html;</p><p> }</p><p></p><p> # proxy the PHP scripts to Apache listening on 127.0.0.1:80</p><p> #</p><p> #location ~ \.php$ {</p><p> # proxy_pass http://127.0.0.1;</p><p> #}</p><p></p><p> # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000</p><p> #</p><p> location ~ \.php$ {</p><p> root html;</p><p> fastcgi_pass 127.0.0.1:9000;</p><p> fastcgi_index index.php;</p><p> fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name;</p><p> include fastcgi_params;</p><p> }</p><p></p><p> # deny access to .htaccess files, if Apache's document root</p><p> # concurs with nginx's one</p><p> #</p><p> #location ~ /\.ht {</p><p> # deny all;</p><p> #}</p><p> }</p><p></p><p></p><p> # another virtual host using mix of IP-, name-, and port-based configuration</p><p> #</p><p> #server {</p><p> # listen 8000;</p><p> # listen somename:8080;</p><p> # server_name somename alias another.alias;</p><p></p><p> # location / {</p><p> # root html;</p><p> # index index.php index.html index.htm;</p><p> # }</p><p> #}</p><p></p><p></p><p> # HTTPS server</p><p> #</p><p> #server {</p><p> # listen 443;</p><p> # server_name localhost;</p><p></p><p> # ssl on;</p><p> # ssl_certificate cert.pem;</p><p> # ssl_certificate_key cert.key;</p><p></p><p> # ssl_session_timeout 5m;</p><p></p><p> # ssl_protocols SSLv2 SSLv3 TLSv1;</p><p> # ssl_ciphers HIGH:!aNULL:!MD5;</p><p> # ssl_prefer_server_ciphers on;</p><p></p><p> # location / {</p><p> # root html;</p><p> # index index.php index.html index.htm;</p><p> # }</p><p> #}</p><p></p><p>}[/CODE]</p></blockquote><p></p>
[QUOTE="Brunx2it, post: 469647, member: 101786"] Hi, I tried to configure Nginx with Braincms but apparently I couldn’t because it gives me 404 error: [CODE]2021/06/14 12:35:07 [error] 7180#6020: *1 connect() failed (10061: Unable to establish connection. Persistent rejection of target computer) while connecting to upstream, client: 127.0.0.1, server: localhost, request: "GET / HTTP/1.1", upstream: "fastcgi://127.0.0.1:9000", host: "127.0.0.1"[/CODE] This is how I tried to configure, I don’t know if it’s even remotely right: [CODE]#user nobody; worker_processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; location / { root html; index index.php; rewrite ^/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=$1; } location /news { rewrite ^/news/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=news&id=$1; } location /home { rewrite ^/home/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=home&user=$1; } location /swf { rewrite ^/swf/habbo-imaging/badge/([a-zA-Z0-9_-]+)(|/)$ /swf/habbo-imaging/badge.php?badge=$1; } location /register { rewrite ^/register/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=register&userref=$1; } location /newpassword { rewrite ^/newpassword/([a-zA-Z0-9_-]+)(|/)$ /index.php?url=newpassword&key=$1; } location /.htaccess { deny all; } location ~ “\.(tpl,sql)$” { deny all; } location /403.shtml { allow all; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # location ~ \.php$ { root html; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME C:/nginx/html/$fastcgi_script_name; include fastcgi_params; } # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} } # another virtual host using mix of IP-, name-, and port-based configuration # #server { # listen 8000; # listen somename:8080; # server_name somename alias another.alias; # location / { # root html; # index index.php index.html index.htm; # } #} # HTTPS server # #server { # listen 443; # server_name localhost; # ssl on; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # ssl_session_timeout 5m; # ssl_protocols SSLv2 SSLv3 TLSv1; # ssl_ciphers HIGH:!aNULL:!MD5; # ssl_prefer_server_ciphers on; # location / { # root html; # index index.php index.html index.htm; # } #} }[/CODE] [/QUOTE]
Insert quotes…
Verification
Post reply
Forums
Server Development
Habbo Retros
Habbo Q&A
Nginx for Brain Cms
Top