Home > nginx > How do I make nginx's folder moveable?

How do I make nginx's folder moveable?

August 27Hits:1
Advertisement

Currently when I compile nginx (in directory /home/parth/nginx), it embeds the prefix supplied to configure script in the nginx binary. Now when I move that folder around (let's say to /tmp), it breaks with following error message. Is there a way to configure logs file directories?

./nginx -p /tmp/ -c /tmp/conf/nginx.conf 

nginx: [alert] could not open error log file: open() "/home/parth/nginx/var/logs/error.log" failed (2: No such file or directory) 2012/08/27 02:22:26 [emerg] 23782#0: unknown log format "main" in /tmp/conf/nginx.conf:25

== nginx.conf file ==

#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.html index.htm;          }      #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;          } 

... rest of the file has commented out configuration and closing brackets. root html;

Answers

[emerg] 23782#0: unknown log format "main" in /tmp/conf/nginx.conf:25

#log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
#                  '$status $body_bytes_sent "$http_referer" '
#                  '"$http_user_agent" "$http_x_forwarded_for"';

Uncomment the log_format line and try again.

Use the error_log config directive.

Tags:nginx

Related Articles

  • How do I make nginx's folder moveable?August 27

    Currently when I compile nginx (in directory /home/parth/nginx), it embeds the prefix supplied to configure script in the nginx binary. Now when I move that folder around (let's say to /tmp), it breaks with following error message. Is there a way to

  • cannot write to nginx www folderApril 29

    I've recently installed nginx on my dev machine with Ubuntu 12.04. I am currently logged in as myuser and after installing nginx I setup the following file permissions (nginx www folder was owned by root so I wanted to change that so I can edit files

  • Nginx redirect folder to subdomainJune 5

    I'm trying to configure a redirect on Nginx from a folder to a subdomain. I've tried already Nginx redirect: folder to external domain and Nginx rewrite rule (subdirectory to subdomain) and nginx: redirect subfolder to subdomain. Nothing works. The p

  • How to take backup of nginx cache folder along with metadata?July 8

    I want to take a backup of nginx cache folder ( the proxy_cache_path ) and its metadata of the main server and use that as the cache folder of a secondary server. This is so that if the main server goes down the secondary server can take its place an

  • How to change the Nginx default folder?September 2

    I setup a server with Nginx and i set my Public_HTML in - /home/user/public_html/website.com/public And its always redirect to - /usr/local/nginx/html/ How can i change this ? Nginx.conf - user www-data www-data; worker_processes 4; events { worker_c

  • Nginx complete folder protection not workingOctober 19

    I have installed nginx(1.4.3) with PHP-FPM(5.4.20). i want to protect my wordpress wp-admin folder. my nginx configuration file domain.conf: server { listen 80; server_name example.com; root /var/www; location / { index index.php; try_files $uri $uri

  • Disable Gateway Timeout for Specific Nginx Port / FolderApril 17

    How can I disable the nginx timeout when accessing through a specific port, or simply a specified folder. Whichever is easier. Basically I have some scripts which need to execute for a long period of time and the gateway timeout is preventing them fr

  • How to check nginx root folderAugust 18

    I have a very basic 404 error: Description: HTTP 404.The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is

  • nginx git folder requestJanuary 10

    Im using nginx and git-web and it works great. I access my site using www.mydomain.org to pull up gitweb. Here is my config file: server { listen 80 default_server; listen [::]:80 default_server; server_name www.mydomain.org; return 301 https://$serv

  • Nginx: Rewrite folder to folder2June 26

    I need to do a simple rewrite, and can't find out how. Rewrite "http://example.com/"index.php/administrator/catalog_product/new/"dumpidum" to "http://example.com/"index.php/administrator/catalog_product/new/set/4/type/simple/

  • Domain points to nginx root folder instead of /var/www/mydomain/webSeptember 3

    After adding and configuring domain in ISPconfig it shows the files from Code: /usr/share/nginx/html/ instead of Code: /var/www/mydomain/web What can be the reason of such issue? Any advice or reference about this would be greate, Thank you! --------

  • nginx proxy folder to urlMay 29

    I have some sites I want to redirect with nginx: domain.com:1180 -> test.domain.com (static site) domain.com:1280 -> test.domain.com/promo (meteor.js website) On domain.com I have an nginx server with the following site enabled: server { listen 80;

  • nginx sub-folder with separated rootJanuary 24

    I have a little problem. I have a wordpress installation in /var/www/xyz/wordpress and now I want to have a piwik installation in the path /var/www/xyz/piwik My current nginx configuration looks like this: server { ... root /var/www/xyz/wordpress; in

  • Nginx - Deny folder, except subfolders with regexSeptember 10

    I want to deny access to anything in the app directory, except in subfolders with an Assets folder. For example: Allow these files /app/bundles/ApiBundle/Assets/css/Thing.js /app/bundles/AssetsBundle/Assets/css/mautic.css Deny these: ``` /app/bundles

  • WP Permalinks won't work without DNS in nginx (ip/folder)November 4

    I am trying to access some of my websites via http://ip.add.re.ss/domain.com so my client can update the website content BEFORE putting it online (pointing the DNS) The website is stored in /var/www/domain.com. The frontpage loads ok, but none of the

  • Nginx protected folderJanuary 8

    Hello, Im trying to protect some pdf files with the built-in protected folder settings on a client website. if I look at the .vhost file for the website I got following lines added: Code: location /images/dokumentation/ { auth_basic "Members Only&quo

  • Nginx redirect: folder to external domainJune 10

    I'm trying to redirect domain1.com/blog/$ to domain2.com/$. How do I edit this to strip the /blog from the redirect? location /blog { rewrite ^/(.*) http://domain2.com/$1 break; } It now redirects domain1.com/blog/blabla to domain2.com/blog/blabla (s

  • nginx rewrite folder http to httpsFebruary 26

    I currently have 2 server containers, 1 for http, and another for the same server but https. I want to merge those containers using Listen 80; and Listen 443 ssl;, which works but I need to rewrite a URL different now: location ^~ /wp-admin { rewrite

  • Nginx + Passenger, getting truncated responsesNovember 23

    Getting truncated responses for big attachments in Redmine, served by Nginx + Passenger. Error log says like following: [ pid=11234 thr=3070954384 file=ext/nginx/HelperAgent.cpp:568 time=2010-11-23 16:05:29.414 ]: Couldn't forward the HTTP response b

  • Nginx : Add/Enable mp4 moduleDecember 19

    Is there a way to enable this module on nginx ? http://wiki.nginx.org/HttpMp4Module I have already many domains running on nginx and I can't just remove it and rebuilt everything . I tried downloading latest nginx, and do ./configure --with-http_mp4_

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.560 s.